Skip to content

Commit 626dc5b

Browse files
committed
GRIF-716.2: Add workfolow_dispatch for promoting bricks stable tag
1 parent a912e76 commit 626dc5b

2 files changed

Lines changed: 114 additions & 3 deletions

File tree

.github/workflows/lcm-pipeline.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,28 @@ jobs:
303303
--repo ${{ github.repository }} \
304304
--body "## LCM bricks image available
305305
306-
New image \`stable/lcm-bricks\` available and tagged for all prod clusters.
307-
Please, manually run the respective rundeck job for each: ${{ secrets.RUNDECK_URL }}
306+
New image \`stable/lcm-bricks\` is available.
308307
309308
| | |
310309
|---|---|
311310
| **Version** | \`${{ needs.prepare-build.outputs.service_version }}\` |
312-
| **Build tag** | \`${{ needs.prepare-build.outputs.image_tag }}\` |"
311+
| **Build tag** | \`${{ needs.prepare-build.outputs.image_tag }}\` |
312+
313+
### Next steps
314+
315+
**1. Tag the image with its major version**
316+
Run the [LCM: Retag stable image to major version](${{ github.server_url }}/${{ github.repository }}/actions/workflows/lcm-stable-retag.yaml) workflow dispatch:
317+
- Go to **Actions → LCM: Retag stable image to major version → Run workflow**
318+
- Set **tag** to \`${{ needs.prepare-build.outputs.service_version }}\`
319+
- Leave **dry-run** unchecked and click **Run workflow**
320+
321+
Or via gh CLI:
322+
\`\`\`
323+
gh workflow run lcm-stable-retag.yaml --repo ${{ github.repository }} -f tag=${{ needs.prepare-build.outputs.service_version }} -f dry-run=false
324+
\`\`\`
325+
326+
**2. Register bricks to prod clusters**
327+
Once the retag completes, manually run the respective Rundeck job for each cluster: ${{ secrets.RUNDECK_URL }}"
313328
env:
314329
GH_TOKEN: ${{ secrets.TOKEN_GITHUB_YENKINS }}
315330

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: "LCM: Retag stable image to major version"
2+
run-name: "Retag stable lcm-bricks ${{ inputs.tag }} → M<major>-<cluster>"
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: 'Stable image tag to retag (e.g. 3.7.106)'
9+
required: true
10+
type: string
11+
dry-run:
12+
description: 'Dry-run only — print crane commands without executing'
13+
required: true
14+
default: false
15+
type: boolean
16+
17+
concurrency:
18+
group: ${{ github.workflow }}
19+
cancel-in-progress: false
20+
21+
jobs:
22+
retag-stable:
23+
name: Retag stable/${{ inputs.tag }} to major version
24+
runs-on:
25+
group: infra1-runners-arc
26+
labels: runners-small
27+
permissions:
28+
id-token: write
29+
contents: read
30+
env:
31+
INFRA_REPO_URL: ${{ secrets.ECR_URL }}
32+
images: "lcm-bricks lcm-bricks-nextversion"
33+
clusters: "na1 ca2 perf1 bom1 syd1 na3 eu1 fra1"
34+
steps:
35+
- name: Get required Vault secrets
36+
uses: hashicorp/vault-action@v3
37+
with:
38+
url: ${{ secrets.VAULT_ADDRESS }}
39+
method: jwt
40+
path: jwt/github
41+
role: ecr-push
42+
secrets: |
43+
secret/data/v3/int/ecr/infra1-user-ecr-rw aws_ecr_access_key | AWS_ACCESS_KEY ;
44+
secret/data/v3/int/ecr/infra1-user-ecr-rw aws_ecr_secret_key | AWS_SECRET_KEY ;
45+
46+
- name: Configure AWS credentials
47+
uses: aws-actions/configure-aws-credentials@v4
48+
with:
49+
aws-access-key-id: ${{ env.AWS_ACCESS_KEY }}
50+
aws-secret-access-key: ${{ env.AWS_SECRET_KEY }}
51+
aws-region: us-east-1
52+
53+
- name: Login to Amazon ECR
54+
uses: aws-actions/amazon-ecr-login@v2
55+
with:
56+
mask-password: 'true'
57+
58+
- name: Retag images
59+
env:
60+
TAG: ${{ inputs.tag }}
61+
DRY_RUN: ${{ inputs.dry-run }}
62+
run: |
63+
set -euo pipefail
64+
major=$(echo "$TAG" | cut -d. -f1)
65+
images=("${{ env.images }}")
66+
clusters=("${{ env.clusters }}")
67+
for image in "${images[@]}"; do
68+
src="${INFRA_REPO_URL}/stable/${image}:${TAG}"
69+
for cluster in "${clusters[@]}"; do
70+
major_tag="M${major}-${cluster}"
71+
if [ "${DRY_RUN}" == 'true' ]; then
72+
echo "[dry-run] crane tag ${src} ${major_tag}"
73+
else
74+
crane tag "${src}" "${major_tag}"
75+
echo "Tagged ${image}:${TAG} → ${image}:${major_tag}"
76+
fi
77+
done
78+
done
79+
80+
- name: Summary
81+
env:
82+
TAG: ${{ inputs.tag }}
83+
run: |
84+
set -euo pipefail
85+
major=$(echo "$TAG" | cut -d. -f1)
86+
clusters=("${{ env.clusters }}")
87+
{
88+
echo "## LCM stable retag"
89+
echo ""
90+
echo "| | |"
91+
echo "|---|---|"
92+
echo "| **Source tag** | \`${TAG}\` |"
93+
echo "| **Major tag pattern** | \`M${major}-<cluster>\` |"
94+
echo "| **Clusters** | \`${clusters[*]}\` |"
95+
echo "| **Dry-run** | \`${{ inputs.dry-run }}\` |"
96+
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)