Skip to content

Commit 66312a7

Browse files
authored
Use environment variables for workflow inputs (#1971)
1 parent 5749e54 commit 66312a7

9 files changed

+102
-53
lines changed

.github/workflows/application-signals-e2e-test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ jobs:
3030
CheckBuildTestArtifacts:
3131
runs-on: ubuntu-latest
3232
steps:
33-
- run: |
34-
if [[ ${{ inputs.build_sha }} == ${{ github.sha }} ]]; then
33+
- env:
34+
BUILD_SHA: ${{ inputs.build_sha }}
35+
GITHUB_SHA_VAL: ${{ github.sha }}
36+
run: |
37+
if [[ "$BUILD_SHA" == "$GITHUB_SHA_VAL" ]]; then
3538
echo "Build SHA matches test SHA"
3639
else
3740
echo "Build SHA does not match test SHA"

.github/workflows/eks-performance-cluster-addon-install.yml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,11 @@ jobs:
175175
176176
# TODO: Revert to using main helm branch when changes from leader-election are merged in
177177
- name: Clone Helm Charts Repository
178+
env:
179+
HELM_CHARTS_BRANCH: ${{ inputs.helm-charts-branch || 'sky333999/leader-election' }}
178180
run: |
179181
rm -rf ./helm-charts
180-
git clone -b ${{ inputs.helm-charts-branch || 'sky333999/leader-election' }} https://github.com/aws-observability/helm-charts.git ./helm-charts
182+
git clone -b "$HELM_CHARTS_BRANCH" https://github.com/aws-observability/helm-charts.git ./helm-charts
181183
182184
- name: Clone Test Repo
183185
uses: actions/checkout@v4
@@ -195,6 +197,16 @@ jobs:
195197
196198
# TODO: Revert to using workflow built agent image once required changes are made on main branch
197199
- name: Check node count and manage Helm chart
200+
env:
201+
INPUT_CLUSTER_NAME: ${{ inputs.cluster_name }}
202+
INPUT_REGION: ${{ inputs.region }}
203+
INPUT_AGENT_REPO: ${{ inputs.cloudwatch_agent_repository }}
204+
INPUT_AGENT_TAG: ${{ inputs.cloudwatch_agent_tag }}
205+
INPUT_OPERATOR_REPO: ${{ inputs.cloudwatch_agent_operator_repository }}
206+
INPUT_OPERATOR_TAG: ${{ inputs.cloudwatch_agent_operator_tag }}
207+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
208+
OPERATOR_SHA: ${{ needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}
209+
GITHUB_SHA_VAL: ${{ github.sha }}
198210
run: |
199211
NODE_COUNT=$(kubectl get nodes --no-headers | wc -l)
200212
@@ -204,28 +216,36 @@ jobs:
204216
else
205217
echo "Node count is $NODE_COUNT, installing/updating Helm chart"
206218
219+
# Set variables with defaults
220+
HELM_CLUSTER_NAME="${INPUT_CLUSTER_NAME:-$CLUSTER_NAME}"
221+
HELM_REGION="${INPUT_REGION:-$AWS_REGION}"
222+
HELM_AGENT_REPO="${INPUT_AGENT_REPO:-$AGENT_ECR_TEST_REPO}"
223+
HELM_AGENT_TAG="${INPUT_AGENT_TAG:-$GITHUB_SHA_VAL}"
224+
HELM_OPERATOR_REPO="${INPUT_OPERATOR_REPO:-$OPERATOR_ECR_TEST_REPO}"
225+
HELM_OPERATOR_TAG="${INPUT_OPERATOR_TAG:-$OPERATOR_SHA}"
226+
207227
# Echo all variables being passed to helm
208-
echo "CLUSTER_NAME: ${{ inputs.cluster_name ||env.CLUSTER_NAME }}"
209-
echo "REGION: ${{ inputs.region || env.AWS_REGION }}"
210-
echo "AGENT_REPOSITORY: ${{ inputs.cloudwatch_agent_repository || env.AGENT_ECR_TEST_REPO }}"
211-
echo "AGENT_TAG: ${{ inputs.cloudwatch_agent_tag || github.sha }}"
212-
echo "AGENT_REPOSITORY_DOMAIN: ${{ steps.login-ecr.outputs.registry }}"
213-
echo "MANAGER_REPOSITORY: ${{ inputs.cloudwatch_agent_operator_repository || env.OPERATOR_ECR_TEST_REPO }}"
214-
echo "MANAGER_TAG: ${{ inputs.cloudwatch_agent_operator_tag || needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }}"
215-
echo "MANAGER_REPOSITORY_DOMAIN: ${{ steps.login-ecr.outputs.registry }}"
228+
echo "CLUSTER_NAME: $HELM_CLUSTER_NAME"
229+
echo "REGION: $HELM_REGION"
230+
echo "AGENT_REPOSITORY: $HELM_AGENT_REPO"
231+
echo "AGENT_TAG: $HELM_AGENT_TAG"
232+
echo "AGENT_REPOSITORY_DOMAIN: $ECR_REGISTRY"
233+
echo "MANAGER_REPOSITORY: $HELM_OPERATOR_REPO"
234+
echo "MANAGER_TAG: $HELM_OPERATOR_TAG"
235+
echo "MANAGER_REPOSITORY_DOMAIN: $ECR_REGISTRY"
216236
217237
helm upgrade --install --wait amazon-cloudwatch-observability \
218238
./helm-charts/charts/amazon-cloudwatch-observability \
219239
--namespace amazon-cloudwatch \
220240
--create-namespace \
221-
--set clusterName=${{ inputs.cluster_name ||env.CLUSTER_NAME }} \
222-
--set region=${{ inputs.region || env.AWS_REGION }} \
241+
--set clusterName="$HELM_CLUSTER_NAME" \
242+
--set region="$HELM_REGION" \
223243
--set agent.image.repository="cloudwatch-agent" \
224244
--set agent.image.tag="latest" \
225245
--set agent.image.repositoryDomainMap.public="public.ecr.aws/q4e2d9n7" \
226-
--set manager.image.repository=${{ inputs.cloudwatch_agent_operator_repository || env.OPERATOR_ECR_TEST_REPO }} \
227-
--set manager.image.tag=${{ inputs.cloudwatch_agent_operator_tag || needs.GetLatestOperatorCommitSHA.outputs.operator_commit_sha }} \
228-
--set manager.image.repositoryDomainMap.public=${{ steps.login-ecr.outputs.registry }} \
246+
--set manager.image.repository="$HELM_OPERATOR_REPO" \
247+
--set manager.image.tag="$HELM_OPERATOR_TAG" \
248+
--set manager.image.repositoryDomainMap.public="$ECR_REGISTRY" \
229249
--values ./test-repo/test/performance/eks/resources/leader_election_overrides/base-overrides.yml
230250
fi
231251

.github/workflows/integration-test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ jobs:
3838
CheckBuildTestArtifacts:
3939
runs-on: ubuntu-latest
4040
steps:
41-
- run: |
42-
if [[ ${{ inputs.build_sha }} == ${{ github.sha }} ]]; then
41+
- env:
42+
BUILD_SHA: ${{ inputs.build_sha }}
43+
GITHUB_SHA_VAL: ${{ github.sha }}
44+
run: |
45+
if [[ "$BUILD_SHA" == "$GITHUB_SHA_VAL" ]]; then
4346
echo "Build SHA matches test SHA"
4447
else
4548
echo "Build SHA does not match test SHA"

.github/workflows/release-candidate-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ jobs:
2525
steps:
2626
- name: SetOutputs
2727
id: set-outputs
28+
env:
29+
TEST_REPO_BRANCH: ${{ inputs.test_repo_branch }}
2830
run: |
29-
CWA_GITHUB_TEST_REPO_BRANCH=${{ inputs.test_repo_branch }}
31+
CWA_GITHUB_TEST_REPO_BRANCH="$TEST_REPO_BRANCH"
3032
echo "CWA_GITHUB_TEST_REPO_BRANCH=${CWA_GITHUB_TEST_REPO_BRANCH:-${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}}" >> "$GITHUB_OUTPUT"
3133
3234
- name: Echo test variables

.github/workflows/repackage-release-artifacts.yml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,50 +40,54 @@ jobs:
4040

4141
- name: Download Artifacts
4242
id: download-artifacts
43+
env:
44+
BUILD_ID: ${{ inputs.build_id }}
4345
run: |
4446
mkdir -p windows/amd64/
45-
aws s3 cp --no-progress s3://${{ env.S3_RELEASE_BUCKET }}/windows/amd64/${{ inputs.build_id }}/AmazonCloudWatchAgent.zip ./windows/amd64/
47+
aws s3 cp --no-progress "s3://${{ env.S3_RELEASE_BUCKET }}/windows/amd64/${BUILD_ID}/AmazonCloudWatchAgent.zip" ./windows/amd64/
4648
4749
mkdir -p linux/amd64
48-
aws s3 cp --no-progress s3://${{ env.S3_RELEASE_BUCKET }}/linux/amd64/${{ inputs.build_id }}/AmazonCloudWatchAgent.zip ./linux/amd64
50+
aws s3 cp --no-progress "s3://${{ env.S3_RELEASE_BUCKET }}/linux/amd64/${BUILD_ID}/AmazonCloudWatchAgent.zip" ./linux/amd64
4951
5052
mkdir -p linux/arm64
51-
aws s3 cp --no-progress s3://${{ env.S3_RELEASE_BUCKET }}/linux/arm64/${{ inputs.build_id }}/AmazonCloudWatchAgent.zip ./linux/arm64
53+
aws s3 cp --no-progress "s3://${{ env.S3_RELEASE_BUCKET }}/linux/arm64/${BUILD_ID}/AmazonCloudWatchAgent.zip" ./linux/arm64
5254
5355
mkdir -p darwin/amd64
54-
aws s3 cp --no-progress s3://${{ env.S3_RELEASE_BUCKET }}/darwin/amd64/${{ inputs.build_id }}/AmazonCloudWatchAgent.zip ./darwin/amd64
56+
aws s3 cp --no-progress "s3://${{ env.S3_RELEASE_BUCKET }}/darwin/amd64/${BUILD_ID}/AmazonCloudWatchAgent.zip" ./darwin/amd64
5557
5658
mkdir -p darwin/arm64
57-
aws s3 cp --no-progress s3://${{ env.S3_RELEASE_BUCKET }}/darwin/arm64/${{ inputs.build_id }}/AmazonCloudWatchAgent.zip ./darwin/arm64
59+
aws s3 cp --no-progress "s3://${{ env.S3_RELEASE_BUCKET }}/darwin/arm64/${BUILD_ID}/AmazonCloudWatchAgent.zip" ./darwin/arm64
5860
5961
- name: Re-upload Artifacts
6062
id: upload-artifacts
63+
env:
64+
BUILD_ID: ${{ inputs.build_id }}
6165
run: |
6266
pushd windows/amd64/
6367
unzip AmazonCloudWatchAgent.zip
64-
aws s3 cp --no-progress ./amazon-cloudwatch-agent.msi s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/packaging/${{ inputs.build_id }}/amazon-cloudwatch-agent.msi
68+
aws s3 cp --no-progress ./amazon-cloudwatch-agent.msi "s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/packaging/${BUILD_ID}/amazon-cloudwatch-agent.msi"
6569
popd
6670
6771
pushd linux/amd64
6872
unzip AmazonCloudWatchAgent.zip
69-
aws s3 cp --no-progress ./amazon-cloudwatch-agent.rpm s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ inputs.build_id }}/linux/amd64/amazon-cloudwatch-agent.rpm
70-
aws s3 cp --no-progress ./amazon-cloudwatch-agent.deb s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ inputs.build_id }}/linux/amd64/amazon-cloudwatch-agent.deb
73+
aws s3 cp --no-progress ./amazon-cloudwatch-agent.rpm "s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/binary/${BUILD_ID}/linux/amd64/amazon-cloudwatch-agent.rpm"
74+
aws s3 cp --no-progress ./amazon-cloudwatch-agent.deb "s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/binary/${BUILD_ID}/linux/amd64/amazon-cloudwatch-agent.deb"
7175
popd
7276
7377
pushd linux/arm64
7478
unzip AmazonCloudWatchAgent.zip
75-
aws s3 cp --no-progress ./amazon-cloudwatch-agent.rpm s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ inputs.build_id }}/linux/arm64/amazon-cloudwatch-agent.rpm
76-
aws s3 cp --no-progress ./amazon-cloudwatch-agent.deb s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/binary/${{ inputs.build_id }}/linux/arm64/amazon-cloudwatch-agent.deb
79+
aws s3 cp --no-progress ./amazon-cloudwatch-agent.rpm "s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/binary/${BUILD_ID}/linux/arm64/amazon-cloudwatch-agent.rpm"
80+
aws s3 cp --no-progress ./amazon-cloudwatch-agent.deb "s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/binary/${BUILD_ID}/linux/arm64/amazon-cloudwatch-agent.deb"
7781
popd
7882
7983
pushd darwin/amd64
8084
unzip AmazonCloudWatchAgent.zip
81-
aws s3 cp --no-progress ./amazon-cloudwatch-agent.pkg s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/packaging/${{ inputs.build_id }}/amd64/amazon-cloudwatch-agent.pkg
85+
aws s3 cp --no-progress ./amazon-cloudwatch-agent.pkg "s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/packaging/${BUILD_ID}/amd64/amazon-cloudwatch-agent.pkg"
8286
popd
8387
8488
pushd darwin/arm64
8589
unzip AmazonCloudWatchAgent.zip
86-
aws s3 cp --no-progress ./amazon-cloudwatch-agent.pkg s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/packaging/${{ inputs.build_id }}/arm64/amazon-cloudwatch-agent.pkg
90+
aws s3 cp --no-progress ./amazon-cloudwatch-agent.pkg "s3://${{ env.S3_INTEGRATION_BUCKET }}/integration-test/packaging/${BUILD_ID}/arm64/amazon-cloudwatch-agent.pkg"
8791
popd
8892
8993
- name: Configure AWS Credentials (CN)
@@ -95,15 +99,17 @@ jobs:
9599

96100
- name: Re-upload Artifacts (CN)
97101
id: upload-artifacts-cn
102+
env:
103+
BUILD_ID: ${{ inputs.build_id }}
98104
run: |
99105
pushd linux/amd64
100-
aws --region cn-north-1 s3 cp --no-progress ./amazon-cloudwatch-agent.rpm s3://${{ env.S3_INTEGRATION_BUCKET_CN }}/integration-test/binary/${{ inputs.build_id }}/linux/amd64/amazon-cloudwatch-agent.rpm
101-
aws --region cn-north-1 s3 cp --no-progress ./amazon-cloudwatch-agent.deb s3://${{ env.S3_INTEGRATION_BUCKET_CN }}/integration-test/binary/${{ inputs.build_id }}/linux/amd64/amazon-cloudwatch-agent.deb
106+
aws --region cn-north-1 s3 cp --no-progress ./amazon-cloudwatch-agent.rpm "s3://${{ env.S3_INTEGRATION_BUCKET_CN }}/integration-test/binary/${BUILD_ID}/linux/amd64/amazon-cloudwatch-agent.rpm"
107+
aws --region cn-north-1 s3 cp --no-progress ./amazon-cloudwatch-agent.deb "s3://${{ env.S3_INTEGRATION_BUCKET_CN }}/integration-test/binary/${BUILD_ID}/linux/amd64/amazon-cloudwatch-agent.deb"
102108
popd
103109
104110
pushd linux/arm64
105-
aws --region cn-north-1 s3 cp --no-progress ./amazon-cloudwatch-agent.rpm s3://${{ env.S3_INTEGRATION_BUCKET_CN }}/integration-test/binary/${{ inputs.build_id }}/linux/arm64/amazon-cloudwatch-agent.rpm
106-
aws --region cn-north-1 s3 cp --no-progress ./amazon-cloudwatch-agent.deb s3://${{ env.S3_INTEGRATION_BUCKET_CN }}/integration-test/binary/${{ inputs.build_id }}/linux/arm64/amazon-cloudwatch-agent.deb
111+
aws --region cn-north-1 s3 cp --no-progress ./amazon-cloudwatch-agent.rpm "s3://${{ env.S3_INTEGRATION_BUCKET_CN }}/integration-test/binary/${BUILD_ID}/linux/arm64/amazon-cloudwatch-agent.rpm"
112+
aws --region cn-north-1 s3 cp --no-progress ./amazon-cloudwatch-agent.deb "s3://${{ env.S3_INTEGRATION_BUCKET_CN }}/integration-test/binary/${BUILD_ID}/linux/arm64/amazon-cloudwatch-agent.deb"
107113
popd
108114
109115
- name: Configure AWS Credentials (ITAR)
@@ -115,15 +121,17 @@ jobs:
115121

116122
- name: Re-upload Artifacts (ITAR)
117123
id: upload-artifacts-itar
124+
env:
125+
BUILD_ID: ${{ inputs.build_id }}
118126
run: |
119127
pushd linux/amd64
120-
aws --region us-gov-east-1 s3 cp --no-progress ./amazon-cloudwatch-agent.rpm s3://${{ env.S3_INTEGRATION_BUCKET_ITAR }}/integration-test/binary/${{ inputs.build_id }}/linux/amd64/amazon-cloudwatch-agent.rpm
121-
aws --region us-gov-east-1 s3 cp --no-progress ./amazon-cloudwatch-agent.deb s3://${{ env.S3_INTEGRATION_BUCKET_ITAR }}/integration-test/binary/${{ inputs.build_id }}/linux/amd64/amazon-cloudwatch-agent.deb
128+
aws --region us-gov-east-1 s3 cp --no-progress ./amazon-cloudwatch-agent.rpm "s3://${{ env.S3_INTEGRATION_BUCKET_ITAR }}/integration-test/binary/${BUILD_ID}/linux/amd64/amazon-cloudwatch-agent.rpm"
129+
aws --region us-gov-east-1 s3 cp --no-progress ./amazon-cloudwatch-agent.deb "s3://${{ env.S3_INTEGRATION_BUCKET_ITAR }}/integration-test/binary/${BUILD_ID}/linux/amd64/amazon-cloudwatch-agent.deb"
122130
popd
123131
124132
pushd linux/arm64
125-
aws --region us-gov-east-1 s3 cp --no-progress ./amazon-cloudwatch-agent.rpm s3://${{ env.S3_INTEGRATION_BUCKET_ITAR }}/integration-test/binary/${{ inputs.build_id }}/linux/arm64/amazon-cloudwatch-agent.rpm
126-
aws --region us-gov-east-1 s3 cp --no-progress ./amazon-cloudwatch-agent.deb s3://${{ env.S3_INTEGRATION_BUCKET_ITAR }}/integration-test/binary/${{ inputs.build_id }}/linux/arm64/amazon-cloudwatch-agent.deb
133+
aws --region us-gov-east-1 s3 cp --no-progress ./amazon-cloudwatch-agent.rpm "s3://${{ env.S3_INTEGRATION_BUCKET_ITAR }}/integration-test/binary/${BUILD_ID}/linux/arm64/amazon-cloudwatch-agent.rpm"
134+
aws --region us-gov-east-1 s3 cp --no-progress ./amazon-cloudwatch-agent.deb "s3://${{ env.S3_INTEGRATION_BUCKET_ITAR }}/integration-test/binary/${BUILD_ID}/linux/arm64/amazon-cloudwatch-agent.deb"
127135
popd
128136
129137
RepackageECRImage:

.github/workflows/test-artifacts.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ jobs:
6161
steps:
6262
- name: SetOutputs
6363
id: set-outputs
64+
env:
65+
TEST_REPO_BRANCH: ${{ inputs.test_repo_branch }}
6466
run: |
65-
CWA_GITHUB_TEST_REPO_BRANCH=${{ inputs.test_repo_branch }}
67+
CWA_GITHUB_TEST_REPO_BRANCH="$TEST_REPO_BRANCH"
6668
6769
echo "CWA_GITHUB_TEST_REPO_NAME=${{ env.CWA_GITHUB_TEST_REPO_NAME }}" >> "$GITHUB_OUTPUT"
6870
echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" >> "$GITHUB_OUTPUT"
@@ -77,18 +79,20 @@ jobs:
7779

7880
- name: Get commit date
7981
id: get-commit-date
82+
env:
83+
BUILD_ID: ${{ inputs.build_id }}
8084
run: |
8185
cd agent-repo # Navigate to agent repo checkout
8286
echo "Extracting commit date from agent repository..."
8387
8488
# Get commit date as Unix timestamp, fallback to 0 for easier backfilling
85-
if [[ "${{ inputs.build_id }}" =~ ^[0-9a-f]{40}$ ]]; then
89+
if [[ "$BUILD_ID" =~ ^[0-9a-f]{40}$ ]]; then
8690
# Full SHA - get date from git log
87-
echo "Full SHA detected: ${{ inputs.build_id }}"
88-
COMMIT_DATE=$(git log -1 --format=%ct ${{ inputs.build_id }} 2>/dev/null || echo "0")
89-
elif [[ "${{ inputs.build_id }}" =~ ^[0-9]+\.[0-9]+\.[0-9a-f]+$ ]]; then
91+
echo "Full SHA detected: $BUILD_ID"
92+
COMMIT_DATE=$(git log -1 --format=%ct "$BUILD_ID" 2>/dev/null || echo "0")
93+
elif [[ "$BUILD_ID" =~ ^[0-9]+\.[0-9]+\.[0-9a-f]+$ ]]; then
9094
# Version format like 1.300057.1b1168 - extract SHA and get date
91-
SHA_PART=$(echo "${{ inputs.build_id }}" | sed 's/.*\.//')
95+
SHA_PART=$(echo "$BUILD_ID" | sed 's/.*\.//')
9296
echo "Version format detected, extracted SHA: $SHA_PART"
9397
COMMIT_DATE=$(git log -1 --format=%ct --grep="$SHA_PART" 2>/dev/null || echo "0")
9498
else
@@ -98,7 +102,7 @@ jobs:
98102
fi
99103
100104
echo "commit_date=${COMMIT_DATE}" >> $GITHUB_OUTPUT
101-
echo "Retrieved commit date: ${COMMIT_DATE} for build_id: ${{ inputs.build_id }}"
105+
echo "Retrieved commit date: ${COMMIT_DATE} for build_id: $BUILD_ID"
102106
103107
if [[ "$COMMIT_DATE" != "0" ]]; then
104108
echo "SUCCESS: Found commit date ${COMMIT_DATE}"

.github/workflows/test-build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ jobs:
126126
- name: Upload to s3
127127
if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
128128
# Copy the RPM to .../amazon_linux/... because BETA customers expect it there.
129+
env:
130+
S3_BUCKET: ${{ inputs.Bucket }}
131+
BUCKET_KEY: ${{ inputs.BucketKey }}
129132
run: |
130-
echo "BucketKey: ${{ inputs.Bucket }} ${{ inputs.BucketKey }}"
131-
aws s3 cp build/bin s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }} --recursive
132-
aws s3 cp build/bin/linux/amd64/amazon-cloudwatch-agent.rpm s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }}/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm
133-
aws s3 cp build/bin/linux/arm64/amazon-cloudwatch-agent.rpm s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }}/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm
133+
echo "BucketKey: ${S3_BUCKET} ${BUCKET_KEY}"
134+
aws s3 cp build/bin "s3://${S3_BUCKET}/${BUCKET_KEY}" --recursive
135+
aws s3 cp build/bin/linux/amd64/amazon-cloudwatch-agent.rpm "s3://${S3_BUCKET}/${BUCKET_KEY}/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm"
136+
aws s3 cp build/bin/linux/arm64/amazon-cloudwatch-agent.rpm "s3://${S3_BUCKET}/${BUCKET_KEY}/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm"

.github/workflows/upload-dependencies.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ jobs:
4545
go-version: ~1.25
4646

4747
- name: Upload Dependencies and Test Repo
48+
env:
49+
S3_BUCKET: ${{ inputs.s3_integration_bucket }}
50+
GITHUB_SHA_INPUT: ${{ inputs.github_sha }}
4851
run: |
4952
go mod tidy
5053
go mod vendor
5154
mkdir test-repo
5255
tar -czf ./test-repo/amazon-cloudwatch-agent-test.tar.gz --exclude='test-repo' .
53-
aws s3 cp ./test-repo/amazon-cloudwatch-agent-test.tar.gz s3://${{ inputs.s3_integration_bucket }}/integration-test/cloudwatch-agent-test-repo/${{ inputs.github_sha }}.tar.gz --quiet
56+
aws s3 cp ./test-repo/amazon-cloudwatch-agent-test.tar.gz "s3://${S3_BUCKET}/integration-test/cloudwatch-agent-test-repo/${GITHUB_SHA_INPUT}.tar.gz" --quiet

.github/workflows/wd-integration-test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ jobs:
3131
CheckBuildTestArtifacts:
3232
runs-on: ubuntu-latest
3333
steps:
34-
- run: |-
35-
if [[ ${{ inputs.build_sha }} == ${{ github.sha }} ]]; then
34+
- env:
35+
BUILD_SHA: ${{ inputs.build_sha }}
36+
GITHUB_SHA_VAL: ${{ github.sha }}
37+
run: |-
38+
if [[ "$BUILD_SHA" == "$GITHUB_SHA_VAL" ]]; then
3639
echo "Build SHA matches test SHA"
3740
else
3841
echo "Build SHA does not match test SHA"

0 commit comments

Comments
 (0)