Add hard deploy option for Gateway workflow
Build and Deploy Gateway / build-and-push (push) Successful in 24s
Build and Deploy Gateway / deploy (push) Successful in 14s

This commit is contained in:
2026-08-19 18:40:01 +03:00
parent b843970ec2
commit d4f228284e
3 changed files with 36 additions and 1 deletions
+14
View File
@@ -33,6 +33,20 @@ test('gateway deploy updates control without recreating dataplane', () => {
assert.doesNotMatch(workflow, /grep -Eq/);
});
test('manual hard deploy safely forces the existing full Gateway path', () => {
assert.match(workflow, /workflow_dispatch:\s*\n\s+inputs:\s*\n\s+hard_deploy:[\s\S]*default: false[\s\S]*type: boolean/);
assert.match(workflow, /env:\s*\n\s+HARD_DEPLOY_INPUT: \$\{\{ inputs\.hard_deploy \}\}/);
assert.match(workflow, /case "\$\{EVENT_NAME\}:\$\{HARD_DEPLOY_INPUT\}" in\s*\n\s+workflow_dispatch:true\) HARD_DEPLOY=true/);
assert.match(workflow, /workflow_dispatch:false\|workflow_dispatch:\|push:false\|push:\) HARD_DEPLOY=false/);
assert.match(workflow, /\*\) echo "Invalid hard deploy request:[^\n]+exit 1/);
assert.match(workflow, /Invalid runtime impact:[\s\S]*DOCKER_BUILD_OPTIONS=\(\)[\s\S]*if \[ "\$HARD_DEPLOY" = "true" \]/);
assert.match(workflow, /Hard deploy requested: forcing no-cache rebuild and deploy of both Gateway images\./);
assert.match(workflow, /AFFECTED_COMPONENTS="control\+dataplane"\s*\n\s+RESTART_SCOPE="both"\s*\n\s+DOCKER_BUILD_OPTIONS=\(--no-cache\)/);
assert.match(workflow, /DOCKER_BUILDKIT=1 docker build \\\n\s+"\$\{DOCKER_BUILD_OPTIONS\[@\]\}"/);
assert.match(workflow, /DOCKER_BUILD_OPTIONS=\(--no-cache\)[\s\S]*affected_components=\$\{AFFECTED_COMPONENTS\}[\s\S]*if \[ "\$RESTART_SCOPE" = "none" \]/);
assert.equal(workflow.match(/bash scripts\/deploy-gateway\.sh/g)?.length, 1);
});
test('runtime images contain only compiled application modules', () => {
for (const dockerfile of dockerfiles) {
assert.match(dockerfile, /RUN npm run build:production/);