Skip to content

Commit

Permalink
update to composer 2 and use mysql instead of mariadb
Browse files Browse the repository at this point in the history
  • Loading branch information
chypriote committed Dec 6, 2020
1 parent 4821cb5 commit 68605d5
Show file tree
Hide file tree
Showing 9 changed files with 3,889 additions and 2,956 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ APP_SECRET=2a45d2e71fe1aa844fad8744ff9846a6
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://gameher:gameherpwd@gh-mariadb:3306/gameher
DATABASE_URL=mysql://gameher:gameherpwd@gh-mysql:3306/gameher
###< doctrine/doctrine-bundle ###

###> oauth2/discord ###
Expand Down
23 changes: 12 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,29 @@ install: ## Install dockers
docker-compose up -d
${MAKE} install-composer-deps
${MAKE} setup-db
${MAKE} setup-ssl
#${MAKE} setup-npm ## commented because very slow
${MAKE} end-message


install-composer-deps: ## Install composer dependencies
docker exec -i gh-web sh -c 'composer clear-cache && composer install'
docker exec -i gh-web sh -c 'cp .env .env.local'
docker exec -i gh-web sh -c "composer clear-cache && composer install"
docker exec -i gh-web sh -c "cp .env .env.local"

setup-db: ## Imports database structure and content to mariadb
docker exec -i gh-web sh -c 'php bin/console do:da:dr --force'
docker exec -i gh-web sh -c 'php bin/console do:da:cr'
docker exec -i gh-web sh -c '/usr/bin/php bin/console do:mi:mi -n'
setup-db: ## Imports database structure and content to mysql
docker exec -i gh-web sh -c "php bin/console do:da:dr --if-exists --force"
docker exec -i gh-web sh -c "php bin/console do:da:cr"
docker exec -i gh-web sh -c "/usr/bin/php bin/console do:mi:mi -n"

setup-ssl: ##Create openssl keys
docker exec -i gh-web sh -c 'openssl genrsa -passout pass:test -out var/jwt/private.pem -aes256 4096'
docker exec -i gh-web sh -c 'openssl rsa -passin pass:test -pubout -in var/jwt/private.pem -out var/jwt/public.pem'
docker exec -i gh-web sh -c "openssl genrsa -passout pass:test -out var/jwt/private.pem -aes256 4096"
docker exec -i gh-web sh -c "openssl rsa -passin pass:test -pubout -in var/jwt/private.pem -out var/jwt/public.pem"

setup-npm: #install npm dependencies
docker exec -i gh-web sh -c 'npm install'
docker exec -i gh-web sh -c "npm install"

assets:
docker exec -i gh-web sh -c 'npm run dev'
docker exec -i gh-web sh -c "npm run dev"

up:
docker-compose up -d --build
Expand All @@ -36,7 +37,7 @@ tty:
docker exec -ti gh-web bash

db:
docker exec -ti gh-mariadb sh -c 'mysql -u gameher -pgameherpwd gameher'
docker exec -ti gh-mysql sh -c "mysql -u gameher -pgameherpwd gameher"

end-message: #
@echo "-------------------------------------------------------------"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ That's it, you are ready

### Develop

If you use the [Symfony CLI](https://symfony.com/download) you can launch a development server with `symfony server:start`, otherwise you need to configure your Apache installation to serve the files from the `public` folder.
If you use the [Symfony CLI](https://symfony.com/download) you can launch a development server with `symfony server:start`, otherwise you need to configure your Apache installation to serve the files from the `public` folder.
You can then launch the webpack server with a watcher by running `npm run watch`

Then head over to http://localhost:3000 (with Symfony CLI) or to your webserver to start working
Expand All @@ -46,7 +46,7 @@ You can then run `npm install` and `npm run dev` at the root of the repository i
You might need to setup your hosts to redirect `gameher.dev` to localhost

After this first installation, you can boot up the docker containers by simply running `make up`
Log into the different containers by running `make tty` for the symfony container and `make db` for the mariadb container
Log into the different containers by running `make tty` for the symfony container and `make db` for the mysql container
Recompile the front assets with `make assets`
Stop the containers with `make stop`

Expand All @@ -57,9 +57,9 @@ The app uses Discord's OAuth server to handle user. In order to login and access

Head over to [Discord's Developer Portal](https://discordapp.com/developers/applications) and create a **New Application** and fill its name
On the *General Information* tab, you can retrieve the client ID and client Secret that you need to add to your `.env` file
On the *OAuth2* tab, click on **Add Redirect** and enter the app's redirect url. The format will be:
`http://YOUR_APP_URL/connect/discord/check
`
On the *OAuth2* tab, click on **Add Redirect** and enter the app's redirect url. The format will be:
`http://YOUR_APP_URL/connect/discord/check`

In the scopes section, select `identify`, `email` and `connections`

Finally, **Save Changes** ! You can now log into the app
Expand All @@ -76,7 +76,7 @@ Then you need to go in your repository `$ cd GameHer` you will also need to set
`$ git remote add upstream git@github.com:Noelierx/GameHer.git`


And you good to work ! Now you just have to create new branches like that :
And you good to work ! Now you just have to create new branches like that :
`$ git checkout -b <add-your-new-branch-name>` Do your stuff and then commit with this command line : `git commit -m "Stuff you have done"`


Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"ext-ctype": "*",
"ext-iconv": "*",
"ext-intl": "*",
"composer-runtime-api": "^2.0",
"doctrine/doctrine-bundle": "^1.11",
"doctrine/doctrine-migrations-bundle": "^2.0",
"doctrine/orm": "^2.6",
Expand Down

0 comments on commit 68605d5

Please sign in to comment.