-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change path and add checks to webauthn database script.
Add docker instructions
- Loading branch information
Showing
1 changed file
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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,15 +1,24 @@ | ||
#!/bin/bash | ||
# | ||
#### To run the database init inside the docker : | ||
### To run inside a runnig docker container | ||
# sudo docker cp /root/01-webauthn-db_init.sh webauthn:/ | ||
# sudo docker exec -it webauthn /bin/bash /01-webauthn-db_init.sh | ||
#### | ||
# | ||
#overwrite database settings for deploy | ||
export DATABASE_URL=mysql://{{ database_webauthn_deploy_user }}:{{ mysql_passwords.webauthndeploy }}@{{ webauthn_db_host }}:3306/{{ database_webauthn_name }} | ||
cd /var/www/html | ||
echo "Create database if not exists" | ||
{{ php_cli }} bin/console doctrine:database:create --if-not-exists | ||
/var/www/html/bin/console doctrine:database:create --if-not-exists | ||
if [ $? -eq 0 ] | ||
then | ||
echo "Done!" | ||
else | ||
echo "Database creation failed" | ||
exit 1 | ||
fi | ||
echo "Create or migrate schema" | ||
{{ php_cli }} bin/console doctrine:migrations:migrate | ||
echo "Done!" | ||
/var/www/html/bin/console doctrine:migrations:migrate | ||
then | ||
echo "Done!" | ||
else | ||
echo "Database migration failed" | ||
exit 1 | ||
fi |