Skip to content

Commit 0cfd4b9

Browse files
authored
Merge pull request #59 from OpenConext/feature/fix-make-devconf-installable-again
Make devconf installable again
2 parents 76e6322 + 10d4197 commit 0cfd4b9

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

core/scripts/init.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ manageurl=https://manage.dev.openconext.local/manage/api/internal/
88

99
set -e
1010

11-
# make sure the docker environment is up
12-
#docker compose up -d --wait
1311
# Bootstrapping engineblock means initialising the database
1412
printf "\n"
1513
echo "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

2018
echo -e "${ORANGE}First, we will initialise the EB database$NOCOLOR ${GREEN}\xE2\x9C\x94${NOCOLOR}"
2119
echo "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
3125
fi
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
3526
echo "Clearing the cache"
3627
echo "Executing docker compose exec engine /var/www/html/app/console cache:clear -n --env=prod"
3728
docker 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

Comments
 (0)