Skip to content

Commit

Permalink
Use env variables for test repo name and url
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenaLee committed Oct 25, 2022
1 parent 832a2f2 commit 80ad5a6
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/integrationTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_TTY: $(tty)
ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test"
CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test"
CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git"

on:
push:
Expand Down Expand Up @@ -128,7 +130,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -161,7 +163,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -223,7 +225,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -368,7 +370,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -388,7 +390,7 @@ jobs:
echo run terraform and execute test code &&
terraform apply --auto-approve
-var="ssh_key_value=${PRIVATE_KEY}"
-var="github_test_repo=https://github.com/aws/amazon-cloudwatch-agent-test.git"
-var="github_test_repo=${CWA_GITHUB_TEST_REPO_URL}"
-var="cwa_github_sha=${GITHUB_SHA}"
-var="s3_bucket=${S3_INTEGRATION_BUCKET}"
-var="ssh_key_name=${KEY_NAME}" &&
Expand All @@ -411,7 +413,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -444,7 +446,7 @@ jobs:
cd terraform/ec2/linux
terraform init
if terraform apply --auto-approve \
-var="ssh_key_value=${PRIVATE_KEY}" -var="github_test_repo=https://github.com/aws/amazon-cloudwatch-agent-test.git" \
-var="ssh_key_value=${PRIVATE_KEY}" -var="github_test_repo=${CWA_GITHUB_TEST_REPO_URL}" \
-var="cwa_github_sha=${GITHUB_SHA}" -var="install_agent=${{ matrix.arrays.installAgentCommand }}" \
-var="ec2_instance_type=${{ matrix.arrays.instanceType }}" \
-var="user=${{ matrix.arrays.username }}" \
Expand Down Expand Up @@ -473,7 +475,7 @@ jobs:
terraform init
if terraform apply --auto-approve \
-var="ssh_key_value=${PRIVATE_KEY}" -var="ssh_key_name=${KEY_NAME}" \
-var="github_repo=aws/amazon-cloudwatch-agent-test.git" \
-var="github_repo=${CWA_GITHUB_TEST_REPO_URL}" \
-var="cwa_github_sha=${GITHUB_SHA}" -var="ami=${{ matrix.arrays.ami }}" \
-var="test_dir=${{ matrix.arrays.test_dir }}" \
-var="ec2_instance_type=${{ matrix.arrays.instanceType }}" \
Expand Down Expand Up @@ -512,7 +514,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -545,7 +547,7 @@ jobs:
cd terraform/ec2/linux
terraform init
if terraform apply --auto-approve \
-var="ssh_key_value=${PRIVATE_KEY}" -var="github_test_repo=https://github.com/aws/amazon-cloudwatch-agent-test.git" \
-var="ssh_key_value=${PRIVATE_KEY}" -var="github_test_repo=${CWA_GITHUB_TEST_REPO_URL}" \
-var="cwa_github_sha=${GITHUB_SHA}" -var="install_agent=${{ matrix.arrays.installAgentCommand }}" \
-var="ec2_instance_type=${{ matrix.arrays.instanceType }}" \
-var="user=${{ matrix.arrays.username }}" \
Expand Down Expand Up @@ -653,7 +655,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -687,7 +689,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -750,7 +752,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: aws/amazon-cloudwatch-agent-test
repository: ${CWA_GITHUB_TEST_REPO_NAME}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -788,7 +790,7 @@ jobs:
cd terraform/ec2/linux
terraform init
if terraform apply --auto-approve \
-var="ssh_key_value=${PRIVATE_KEY}" -var="github_test_repo=https://github.com/aws/amazon-cloudwatch-agent-test.git" \
-var="ssh_key_value=${PRIVATE_KEY}" -var="github_test_repo=${CWA_GITHUB_TEST_REPO_URL}" \
-var="cwa_github_sha=${GITHUB_SHA}" -var="install_agent=${{ matrix.arrays.installAgentCommand }}" \
-var="user=${{ matrix.arrays.username }}" \
-var="ami=${{ matrix.arrays.ami }}" \
Expand Down

0 comments on commit 80ad5a6

Please sign in to comment.