fix(ci): fail fast when the deploy dir has no DATABASE_URL
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:
1 parent
bc00ecf08c
commit
80d7ae14ba
2 files changed
+18
-1
No files matched your search
@@ -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")], {
|
||||
|
||||
Reference in new issue
Block a user