Skip to content

Commit bbb2b5d

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

2 files changed

Lines changed: 112 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: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: "LCM: Retag stable image to major version"
2+
run-name: "Retag stable lcm-bricks ${{ inputs.tag }} → M${{ inputs.tag }}"
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+
steps:
33+
- name: Get required Vault secrets
34+
uses: hashicorp/vault-action@v3
35+
with:
36+
url: ${{ secrets.VAULT_ADDRESS }}
37+
method: jwt
38+
path: jwt/github
39+
role: ecr-push
40+
secrets: |
41+
secret/data/v3/int/ecr/infra1-user-ecr-rw aws_ecr_access_key | AWS_ACCESS_KEY ;
42+
secret/data/v3/int/ecr/infra1-user-ecr-rw aws_ecr_secret_key | AWS_SECRET_KEY ;
43+
44+
- name: Configure AWS credentials
45+
uses: aws-actions/configure-aws-credentials@v4
46+
with:
47+
aws-access-key-id: ${{ env.AWS_ACCESS_KEY }}
48+
aws-secret-access-key: ${{ env.AWS_SECRET_KEY }}
49+
aws-region: us-east-1
50+
51+
- name: Login to Amazon ECR
52+
uses: aws-actions/amazon-ecr-login@v2
53+
with:
54+
mask-password: 'true'
55+
56+
- name: Retag images
57+
env:
58+
TAG: ${{ inputs.tag }}
59+
DRY_RUN: ${{ inputs.dry-run }}
60+
run: |
61+
set -euo pipefail
62+
major=$(echo "$TAG" | cut -d. -f1)
63+
images=(lcm-bricks lcm-bricks-nextversion)
64+
clusters=(na1 ca2 perf1 bom1 syd1 na3 eu1 fra1)
65+
for image in "${images[@]}"; do
66+
src="${INFRA_REPO_URL}/stable/${image}:${TAG}"
67+
for cluster in "${clusters[@]}"; do
68+
major_tag="M${major}-${cluster}"
69+
if [ "${DRY_RUN}" == 'true' ]; then
70+
echo "[dry-run] crane tag ${src} ${major_tag}"
71+
else
72+
crane tag "${src}" "${major_tag}"
73+
echo "Tagged ${image}:${TAG} → ${image}:${major_tag}"
74+
fi
75+
done
76+
done
77+
78+
- name: Summary
79+
env:
80+
TAG: ${{ inputs.tag }}
81+
run: |
82+
set -euo pipefail
83+
major=$(echo "$TAG" | cut -d. -f1)
84+
clusters=(na1 ca2 perf1 bom1 syd1 na3 eu1 fra1)
85+
{
86+
echo "## LCM stable retag"
87+
echo ""
88+
echo "| | |"
89+
echo "|---|---|"
90+
echo "| **Source tag** | \`${TAG}\` |"
91+
echo "| **Major tag pattern** | \`M${major}-<cluster>\` |"
92+
echo "| **Clusters** | \`${clusters[*]}\` |"
93+
echo "| **Dry-run** | \`${{ inputs.dry-run }}\` |"
94+
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)