Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/deploy-staging-admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ on:
default: gateway-admin
options:
- gateway-admin
- admin-front
actor:
required: true
type: string
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/deploy-staging-frontends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ on:
type: choice
default: user-front
options:
- admin-front
- user-front
- docs-front
prebuilt_image_digest:
required: false
type: string
description: "Optional immutable Artifact Registry image@sha256 digest for admin-front/user-front/docs-front."
actor:
required: true
type: string
Expand Down Expand Up @@ -155,10 +157,10 @@ jobs:
set -euo pipefail
echo "FAILED_STEP=resolve_frontend_deploy_scope" >> "$GITHUB_ENV"
case "${DEPLOY_SCOPE}" in
user-front|docs-front)
admin-front|user-front|docs-front)
;;
*)
echo "Deploy Staging Frontends only supports user-front or docs-front; got ${DEPLOY_SCOPE}" >&2
echo "Deploy Staging Frontends only supports admin-front, user-front, or docs-front; got ${DEPLOY_SCOPE}" >&2
exit 2
;;
esac
Expand All @@ -171,7 +173,7 @@ jobs:
const fs = require('fs')
const scope = JSON.parse(fs.readFileSync('scope.json', 'utf8'))
const unsupported = (scope.services || []).filter(
(service) => !['user-front', 'docs-front'].includes(service)
(service) => !['admin-front', 'user-front', 'docs-front'].includes(service)
)
if (unsupported.length > 0) {
throw new Error(`frontend workflow received unsupported services: ${unsupported.join(', ')}`)
Expand Down Expand Up @@ -224,7 +226,7 @@ jobs:
const region = process.env.REGION
const repository = process.env.ARTIFACT_REGISTRY_REPOSITORY
const services = (process.env.DEPLOY_SERVICES || '').split(',').filter(Boolean)
if (!['user-front', 'docs-front'].includes(service)) {
if (!['admin-front', 'user-front', 'docs-front'].includes(service)) {
throw new Error(`prebuilt frontend image is not supported for ${service}`)
}
if (services.length !== 1 || services[0] !== service) {
Expand Down Expand Up @@ -290,6 +292,7 @@ jobs:
const fs = require('fs')
const images = JSON.parse(fs.readFileSync('image-digests.json', 'utf8'))
const names = {
'admin-front': 'synapse-staging-admin-front',
'user-front': 'synapse-staging-user-front',
'docs-front': 'synapse-staging-docs-front',
}
Expand Down Expand Up @@ -330,6 +333,7 @@ jobs:
const fs = require('fs')
const images = JSON.parse(fs.readFileSync('image-digests.json', 'utf8'))
const names = {
'admin-front': 'synapse-staging-admin-front',
'user-front': 'synapse-staging-user-front',
'docs-front': 'synapse-staging-docs-front',
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No new lessons.
8 changes: 2 additions & 6 deletions scripts/deploy/deploy_staging_frontends_workflow.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,12 @@ test("staging frontend workflow is standalone and does not run database migratio
);
});

test("staging frontend workflow only accepts user-front and docs-front", () => {
test("staging frontend workflow accepts the three frontend services", () => {
const text = workflowText();

assert.match(text, /deploy_scope:[\s\S]*options:[\s\S]*-\s+admin-front/);
assert.match(text, /deploy_scope:[\s\S]*options:[\s\S]*-\s+user-front/);
assert.match(text, /deploy_scope:[\s\S]*options:[\s\S]*-\s+docs-front/);
assert.doesNotMatch(
text,
/deploy_scope:[\s\S]*options:[\s\S]*-\s+admin-front/,
"admin-front must continue through the admin workflow because it depends on gateway-admin migration"
);
});

test("staging frontend workflow has bounded long-running steps", () => {
Expand Down
9 changes: 5 additions & 4 deletions scripts/deploy/local_build_staging_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ ATTACH="auto"
usage() {
cat <<'USAGE'
Usage:
scripts/deploy/local_build_staging_image.sh --service user-front --ref main --release-task-id 123
scripts/deploy/local_build_staging_image.sh --service admin-front --ref main --release-task-id 123

Options:
--service <user-front|docs-front> Frontend service to build.
--service <admin-front|user-front|docs-front>
Frontend service to build.
--ref <branch|tag|sha> Git ref to build from. Default: main.
--release-task-id <id> Attach the immutable digest to this Ops Console release task.
--ops-console-url <url> Ops Console URL. Default: http://localhost:9700.
Expand Down Expand Up @@ -77,10 +78,10 @@ require_cmd docker
require_cmd node

case "${SERVICE}" in
user-front|docs-front)
admin-front|user-front|docs-front)
;;
*)
echo "--service must be user-front or docs-front" >&2
echo "--service must be admin-front, user-front, or docs-front" >&2
exit 2
;;
esac
Expand Down
Loading