Skip to content

Commit 3a389be

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

2 files changed

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

0 commit comments

Comments
 (0)