new: [opensem] add automatic database migration

This commit is contained in:
Valentin Lab
2025-10-05 02:33:47 +02:00
parent f74e9b8ea8
commit a2f98fd1cf
2 changed files with 6 additions and 7 deletions

View File

@@ -5,3 +5,6 @@
set -e
mv -v "${OPENSEM_CONFIG_FILE}" "${OPENSEM_CONFIG_FILE%.prepare}"
artisan migrate -v --force &&
artisan migrate -v --path=database/migrations/shop --force

View File

@@ -111,16 +111,12 @@ artisan() {
export COMPOSE_IGNORE_ORPHANS=true
php_fpm_service=$(service:traverse "$SERVICE_NAME":php-fpm) || return 1
## We don't want post deploy that is doing the final http initialization.
compose --debug -q --no-init --no-post-deploy --no-pre-deploy \
--without-relation="$SERVICE_NAME":publish-dir \
run \
"${artisan_docker_run_opts[@]}" \
launch_docker_compose run \
-T --rm -w /opt/apps/"$SERVICE_NAME" \
--entrypoint php \
-u www-data "$php_fpm_service" artisan "$@" | cat
-u www-data "$php_fpm_service" artisan "$@"
return "${PIPESTATUS[0]}"
return "$?"
}
dotenv:quote() {