Skip to content

Commit

Permalink
make it backward compatible by checking for presence of APP_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Feb 27, 2024
1 parent 29b1990 commit 7b07484
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions application/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ chown -R www-data:www-data \
echo 'sleeping a random number of seconds up to 9 to avoid migration runs clash'
sleep $[ ( $RANDOM % 10 ) ]s

if [[ -z "${APP_ID}" ]]; then
/data/yii migrate --interactive=0

# Run database migrations
config-shim -v --app $APP_ID --config $CONFIG_ID --env $ENV_ID /data/yii migrate --interactive=0

if [[ ! -z $RUN_TASK ]]; then
if [[ ! -z $RUN_TASK ]]; then
./yii $RUN_TASK
exit $?
fi
fi

apache2ctl -k start -D FOREGROUND
else
config-shim -v --app $APP_ID --config $CONFIG_ID --env $ENV_ID /data/yii migrate --interactive=0

config-shim -v --app $APP_ID --config $CONFIG_ID --env $ENV_ID apache2ctl -k start -D FOREGROUND
if [[ ! -z $RUN_TASK ]]; then
config-shim -v --app $APP_ID --config $CONFIG_ID --env $ENV_ID ./yii $RUN_TASK
exit $?
fi

config-shim -v --app $APP_ID --config $CONFIG_ID --env $ENV_ID apache2ctl -k start -D FOREGROUND
fi

0 comments on commit 7b07484

Please sign in to comment.