@@ -8,8 +8,6 @@ manageurl=https://manage.dev.openconext.local/manage/api/internal/
88
99set -e
1010
11- # make sure the docker environment is up
12- # docker compose up -d --wait
1311# Bootstrapping engineblock means initialising the database
1412printf " \n"
1513echo " Bring up the engineblock container to bootstrap the database"
@@ -19,23 +17,16 @@ docker compose exec engine timeout 300 bash -c 'while [[ "$(curl -k -s -o /dev/n
1917
2018echo -e " ${ORANGE} First, we will initialise the EB database$NOCOLOR ${GREEN} \xE2\x9C\x94${NOCOLOR} "
2119echo " Checking if the database is already present"
22- engineversion=$( docker compose exec engine /var/www/html/app/console doctrine:migrations:status --env=prod |
23- grep " Current Version" | awk ' {print $4 }' )
24- if [[ $engineversion == " 0" ]]; then
20+ if ! docker compose exec engine /var/www/html/app/console doctrine:schema:validate -q --skip-mapping --env=prod; then
2521 echo creating the database schema
2622 echo " Executing docker compose exec engine /var/www/html/app/console doctrine:schema:create --env prod"
2723 docker compose exec engine /var/www/html/app/console doctrine:schema:create --env prod
28- echo " Updating engineblock to the latest migration"
29- echo " Executing docker compose exec engine /var/www/html/app/console doctrine:migrations:version -n --add --all --env=prod"
30- docker compose exec engine /var/www/html/app/console doctrine:migrations:version -n --add --all --env=prod
24+ # TODO: Use migrations instead of schema:create. Not both. @see https://github.com/OpenConext/OpenConext-engineblock/issues/1861
3125fi
32- echo " making sure all migrations have been executed"
33- echo " executing docker compose exec engine /var/www/html/app/console doctrine:migrations:migrate -n --env=prod"
34- docker compose exec engine /var/www/html/app/console doctrine:migrations:migrate -n --env=prod
3526echo " Clearing the cache"
3627echo " Executing docker compose exec engine /var/www/html/app/console cache:clear -n --env=prod"
3728docker compose exec engine /var/www/html/app/console cache:clear -n --env=prod
38- docker compose exec engine chown -R www-data /var/www/html/app/cache/
29+ docker compose exec engine chown -R www-data:www-data /var/www/html/app/cache/
3930
4031# Now it's time to bootstrap manage
4132# Bring up containers needed for bootstrapping manage
0 commit comments