Skip to content

Commit 537c379

Browse files
authored
Include CD options to disable latest tag update and operator mirroring. (#787)
1 parent 3433fa2 commit 537c379

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

.github/pull_request_template.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
**Description:** <Describe what has changed.
2-
Ex. Fixing a bug - Describe the bug and how this fixes the issue.
3-
Ex. Adding a feature - Explain what this achieves.>
1+
**Description:** <Describe what has changed.>
2+
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
3+
Ex. Adding a feature - Explain what this achieves.-->
44

55
**Link to tracking Issue:** <Issue number if applicable>
66

7-
**Testing:** < Describe what testing was performed and which tests were added.>
7+
**Testing:** <Describe what testing was performed and which tests were added.>
88

9-
**Documentation:** < Describe the documentation added.>
9+
**Documentation:** <Describe the documentation added.>

.github/workflows/CD.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ on:
2222
sha:
2323
description: 'the github sha to release'
2424
required: true
25+
update-latest:
26+
description: 'update the latest tag in the repos (default: true)'
27+
required: false
28+
default: 'true'
29+
mirror-operator:
30+
description: 'mirror the operator (default: true)'
31+
required: false
32+
default: 'true'
2533

2634
env:
2735
IMAGE_NAME: aws-otel-collector
@@ -346,15 +354,19 @@ jobs:
346354
TAG=`cat build/packages/VERSION`
347355
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/aws-observability
348356
docker tag $IMAGE_NAME public.ecr.aws/$ECR_REPO:$TAG
349-
docker tag $IMAGE_NAME public.ecr.aws/$ECR_REPO:latest
350357
docker push public.ecr.aws/$ECR_REPO:$TAG
351-
docker push public.ecr.aws/$ECR_REPO:latest
352-
cd adot/tools/release/adot-operator-images-mirror && go run ./
358+
if [ ${{ github.event.inputs.update-latest }} == 'true' ]; then
359+
docker tag $IMAGE_NAME public.ecr.aws/$ECR_REPO:latest
360+
docker push public.ecr.aws/$ECR_REPO:latest
361+
fi
362+
if [ ${{ github.event.inputs.mirror-operator }} == 'true' ]; then
363+
cd adot/tools/release/adot-operator-images-mirror && go run ./
364+
fi
353365
354366
- name: Login Dockerhub
355367
uses: docker/login-action@v1
356368
with:
357-
username: "mxiamxia"
369+
username: "${{ secrets.DOCKERHUB_RELEASE_USERNAME }}"
358370
password: "${{ secrets.DOCKERHUB_RELEASE_TOKEN }}"
359371

360372
- name: Push Image to dockerhub
@@ -363,9 +375,11 @@ jobs:
363375
TAG=`cat build/packages/VERSION`
364376
REPO_NAME="$IMAGE_NAMESPACE/$IMAGE_NAME"
365377
docker tag $IMAGE_NAME $REPO_NAME:$TAG
366-
docker tag $IMAGE_NAME $REPO_NAME:latest
367378
docker push $REPO_NAME:$TAG
368-
docker push $REPO_NAME:latest
379+
if [ ${{ github.event.inputs.update-latest }} == 'true' ]; then
380+
docker tag $IMAGE_NAME $REPO_NAME:latest
381+
docker push $REPO_NAME:latest
382+
fi
369383
370384
371385
release-validation-ecs:

.github/workflows/CI.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,13 +967,15 @@ jobs:
967967
tar czvf $GITHUB_SHA.tar.gz build
968968
aws s3 cp $GITHUB_SHA.tar.gz s3://aws-otel-collector-release-candidate/$GITHUB_SHA.tar.gz
969969
970-
- id: file_changes
971-
uses: trilom/[email protected]
970+
- id: filter
971+
uses: dorny/paths-filter@v2
972972
with:
973-
fileOutput: ''
973+
filters: |
974+
version:
975+
- 'VERSION'
974976
975977
- name: Trigger soaking
976-
if: contains(steps.file_changes.outputs.files_modified, 'VERSION')
978+
if: steps.filter.outputs.version == 'true'
977979
uses: peter-evans/[email protected]
978980
with:
979981
token: "${{ secrets.REPO_WRITE_ACCESS_TOKEN }}"

.github/workflows/soaking.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ env:
3131
TF_VAR_aws_secret_access_key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
3232
TF_VAR_patch: 'true'
3333

34+
concurrency:
35+
group: soaking
36+
3437
jobs:
3538
build-aotutil:
3639
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)