-
Notifications
You must be signed in to change notification settings - Fork 6
Feat/core #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MicaelMnl
wants to merge
10
commits into
Linkvalue:master
Choose a base branch
from
MicaelMnl:feat/core
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/core #105
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
058f0d2
feat(docker): add docker
MicaelMnl 076abda
feat(env): add env vars
MicaelMnl 47ca00e
feat(assets): update assets dependencies and webpack config
MicaelMnl cf574eb
feat(core): upgrade symfony 3.3 => 3.4
MicaelMnl 923d9c3
feat(git): ignore .data docker volume and .env file
MicaelMnl 218c17e
feat(doc): update doc
MicaelMnl b4f3aee
chore(core): clean repo
MicaelMnl b52a3df
feat(travis): remove support php 5.6 and 7.0
MicaelMnl 91f2412
feat(heroku): add heroku config
MicaelMnl df3e7ac
refacto(travis): refacto travis ci
MicaelMnl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # symfony/framework-bundle | ||
| APP_ENV=dev | ||
| URL=local.appbuild.com | ||
| DB_URL=mysql://appbuild_usr:[email protected]/appbuild_db | ||
| SYMFONY_SECRET=ThisTokenIsNotSoSecretChangeIt | ||
| # Supported values are 'en' and 'fr' | ||
| DEFAULT_LOCALE=en | ||
| # Timezone to use when displaying dates (either on backoffice or API) | ||
| TIMEZONE=UTC | ||
Oliboy50 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Symfony session path (set this to '/tmp/sessions' for example if you encounter some issues in dev environment) | ||
| SESSION_SAVE_PATH=%kernel.project_dir%/var/sessions/%kernel.environment% | ||
Oliboy50 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Path to the directory where builds file will be stored | ||
| BUILDS_APPLICATION_DIR=%kernel.project_dir%/var/build_files | ||
Oliboy50 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # symfony/swiftmailer-bundle | ||
| MAILER_TRANSPORT=smtp | ||
| MAILER_HOST=127.0.0.1 | ||
| MAILER_USER=null | ||
| MAILER_PASSWORD=null | ||
| # webpack-dev-server (to watch assets modification in development environment) | ||
| WEBPACK_DEV_SERVER_BASE_URL=http://local.appbuild.com:8080 | ||
| # JWT parameters for API authentication | ||
| JWT_PRIVATE_KEY_PATH=%kernel.project_dir%/var/jwt/private.pem | ||
Oliboy50 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| JWT_PUBLIC_KEY_PATH=%kernel.project_dir%/var/jwt/public.pem | ||
| JWT_KEY_PASS_PHRASE=Appbuild | ||
| # Approximately one year | ||
| JWT_TOKEN_TTL=31536000 | ||
Oliboy50 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,34 @@ | ||
| language: php | ||
|
|
||
| php: | ||
| - 5.6.19 | ||
| - 7.0 | ||
| - 7.1 | ||
|
|
||
| services: | ||
| - mysql | ||
|
|
||
| env: | ||
| - APP_ENV=dev | ||
| URL=local.appbuild.com | ||
| DB_URL=mysql://[email protected]/appbuild_db | ||
| SYMFONY_SECRET=ThisTokenIsNotSoSecretChangeIt | ||
| DEFAULT_LOCALE=en | ||
| TIMEZONE=UTC | ||
| SESSION_SAVE_PATH=%kernel.project_dir%/var/sessions/%kernel.environment% | ||
| BUILDS_APPLICATION_DIR=%kernel.project_dir%/var/build_files | ||
| MAILER_TRANSPORT=smtp | ||
| MAILER_HOST=127.0.0.1 | ||
| MAILER_USER=null | ||
| MAILER_PASSWORD=null | ||
| WEBPACK_DEV_SERVER_BASE_URL=http://local.appbuild.com:8080 | ||
| JWT_PRIVATE_KEY_PATH=%kernel.project_dir%/var/jwt/private.pem | ||
| JWT_PUBLIC_KEY_PATH=%kernel.project_dir%/var/jwt/public.pem | ||
| JWT_KEY_PASS_PHRASE=Appbuild | ||
| JWT_TOKEN_TTL=31536000 | ||
|
|
||
| before_script: | ||
| - cp .env.dist .env | ||
| - nvm install "$(jq -r '.engines.node' package.json)" | ||
| - make install-bin-dev install-bin-prod install-composer install-npm db-build assets-build | ||
| - make install-bin-dev install-bin-prod install-composer install-npm db-build-test assets-build | ||
|
|
||
| script: | ||
| - npm run lint | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,35 +2,52 @@ | |
|
|
||
| ## Development | ||
|
|
||
| This project uses [LinkValue/majora-ansible-vagrant v2.2.0](https://github.com/LinkValue/majora-ansible-vagrant/tree/v2.2.0) as its development environment, | ||
| so please head to this link and fulfill the **Requirements** section for your OS before anything else. | ||
| Requirements | ||
| - Docker | ||
| - Docker compose | ||
|
|
||
| ### Installation | ||
|
|
||
| #### 1. Clone project | ||
| ```shell | ||
| git clone [email protected]:LinkValue/Appbuild.git | ||
| ```shell | ||
| # Add this line to the host file /etc/hosts | ||
| 127.0.0.1 local.appbuild.com | ||
|
|
||
| # copy sources from GitHub | ||
| git clone https://github.com/LinkValue/Appbuild.git | ||
| cd Appbuild | ||
| ``` | ||
|
|
||
| #### 2. Virtual machine provisioning | ||
| ```shell | ||
| make provision | ||
| ``` | ||
| # Start project | ||
| docker-compose up -d | ||
|
|
||
| Note: If it unluckily fails at some point, don't hesitate to re-run this command several times. | ||
| # Setup api | ||
| # Get a bash shell in the nginx container | ||
| docker exec -it appbuild_nginx bash | ||
| cd /app | ||
|
|
||
| #### 3. Install project | ||
| ```shell | ||
| # connect to the VM | ||
| make ssh | ||
| # install the project for development (you'll have to press "Enter" several times to configure the project with default parameters) | ||
| make install | ||
| ``` | ||
| # Install JWT | ||
| mkdir -p var/jwt | ||
| test -f var/jwt/private.pem || openssl genrsa -out var/jwt/private.pem -passout pass:Appbuild -aes256 4096 | ||
| test -f var/jwt/public.pem || openssl rsa -in var/jwt/private.pem -passin pass:Appbuild -pubout -out var/jwt/public.pem | ||
|
|
||
| #### 4. Enjoy | ||
| # Setup db | ||
| # use php-fpm container | ||
| docker exec -it appbuild_php_fpm php bin/console doctrine:database:create --if-not-exists | ||
| docker exec -it appbuild_php_fpm php bin/console doctrine:migrations:migrate -n | ||
| docker exec -it appbuild_php_fpm php bin/console doctrine:fixtures:load -n --fixtures=src/UserBundle | ||
|
|
||
| You should see your application up and running at http://local.appbuild.com/app_dev.php/ | ||
| # Reset db | ||
| # use php-fpm conatainer | ||
| docker exec -it appbuild_php_fpm php bin/console doctrine:database:drop --force --if-exists | ||
| docker exec -it appbuild_php_fpm php bin/console doctrine:database:create | ||
|
|
||
| # You can also watch asset modifications | ||
| docker logs -f appbuild_node | ||
|
|
||
| # Start webpack server if is not started yet, use node container | ||
| docker exec -it appbuild_node npm start | ||
| ``` | ||
|
|
||
| You should see your application up and running at http://local.appbuild.com | ||
|
|
||
| Try to login using one of the following credentials: | ||
| ``` | ||
|
|
@@ -40,17 +57,6 @@ [email protected] => admin | |
| [email protected] => user | ||
| ``` | ||
|
|
||
| ### Frontend development | ||
|
|
||
| Front assets (css/js/images) are handled by [Webpack](https://webpack.js.org/). | ||
|
|
||
| When you're in production environment (i.e. `http://local.appbuild.com/...`), the project will use the assets found in `web/assets`, it means that you'll have to run `make assets-build` each time you edit an asset file to see the modification in your browser (after refreshing it manually). | ||
|
|
||
| When you're in development environment (i.e. `http://local.appbuild.com/app_dev.php/...`), you can also watch asset modifications to benefit from the hot reloading feature of webpack-dev-server, by typing the following command: | ||
| ```shell | ||
| make assets-watch | ||
| ``` | ||
|
|
||
| ### Common tasks | ||
| ```shell | ||
| # rebuild the whole database with clean fixtures | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| web: $(composer config bin-dir)/heroku-php-nginx -C nginx_app.conf web/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.