fix(ci): fail fast when the deploy dir has no DATABASE_URL
Gitea Actions Runner Test / test-job (push) Successful in 1s
CI / check (push) Successful in 34s
CI / tests-unit (push) Successful in 1m42s
CI / tests-integration (push) Successful in 1m48s
CI / tests-ui (push) Successful in 2m35s
CI / preflight (push) Skipped
CI / deploy (push) Failing after 1m37s

pnpm db:migrate runs on the host and reads DATABASE_URL from the deploy
directory's .env. When that variable was missing the deploy had already
built an image and run the browser gate before pnpm db:migrate aborted on
an empty value, so a release was paid for in full and then thrown away.

Check for the variable right after the .env is copied, before the build,
and say plainly that the live release was not touched. The deploy test
fixture gains a DATABASE_URL so it mirrors a working deploy directory
instead of the broken one.
This commit is contained in:
openhands committed 2026-09-27 18:57:10 +02:00
1 parent bc00ecf08c
commit 80d7ae14ba
2 files changed
+18 -1

No files matched your search

+6 -1
View File
@@ -33,7 +33,12 @@ function simulate(
const dir = mkdtempSync(join(tmpdir(), "cms-deploy-test-"));
try {
mkdirSync(join(dir, "production"));
writeFileSync(join(dir, "production", ".env"), 'HOTEL_NAME="Test Hotel"\n');
// Een werkende deploymap heeft een DATABASE_URL; die gebruikt
// scripts/ci-deploy.sh voor de migraties op de host.
writeFileSync(
join(dir, "production", ".env"),
'HOTEL_NAME="Test Hotel"\nDATABASE_URL="mysql://test:[email protected]:3306/test"\n',
);
if (previous) writeFileSync(join(dir, previous), "old\n");
if (both) writeFileSync(join(dir, "epicnext-cms-app"), "old\n");
const result = spawnSync(bash, [resolve(root, "scripts/ci-deploy.sh")], {