Skip to content

Commit

Permalink
Change sha date
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhntd committed Jul 11, 2022
1 parent 871952e commit dd61d0f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 28 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/integrationTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
push:
branches:
- master

workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -136,6 +136,7 @@ jobs:
echo "${GPG_PRIVATE_KEY}" | gpg --batch --import -
for f in $(find build/bin/); do if [ ! -d $f ]; then echo "Signing file $f" && echo "${PASSPHRASE}" | gpg --detach-sign --passphrase-fd 0 --batch --default-key "${GPG_KEY_NAME}" $f ; fi ; done
- name: Upload to s3
if: steps.cached_binaries.outputs.cache-hit != 'true'
run: aws s3 cp build/bin s3://${S3_INTEGRATION_BUCKET}/integration-test/binary/${{ github.sha }} --recursive
Expand Down Expand Up @@ -400,7 +401,7 @@ jobs:
arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.ec2_linux_matrix) }}
steps:
- uses: actions/checkout@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down Expand Up @@ -524,11 +525,12 @@ jobs:
retry_wait_seconds: 5
command: cd cd integration/terraform/ec2/win && terraform destroy --auto-approve -var="ami=${{ matrix.arrays.ami }}"


StopLocalStack:
name: 'StopLocalStack'
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [StartLocalStack, EC2LinuxIntegrationTest]
needs: [ StartLocalStack, EC2LinuxIntegrationTest ]
defaults:
run:
working-directory: integration/terraform/ec2/localstack
Expand Down Expand Up @@ -583,7 +585,7 @@ jobs:
id: login-ecr
if: steps.ecs-fargate-integration-test.outputs.cache-hit != 'true'
uses: aws-actions/amazon-ecr-login@v1

- name: Verify Terraform version
if: steps.ecs-fargate-integration-test.outputs.cache-hit != 'true'
run: terraform --version
Expand All @@ -603,7 +605,7 @@ jobs:
else
terraform destroy -auto-approve && exit 1
fi
- name: Terraform destroy
if: ${{ cancelled() && steps.ecs-fargate-integration-test.outputs.cache-hit != 'true' }}
uses: nick-invision/retry@v2
Expand Down Expand Up @@ -667,10 +669,8 @@ jobs:
-var="binary_name=amazon-cloudwatch-agent.rpm" \
-var="local_stack_host_name=${{ needs.StartLocalStack.outputs.local_stack_host_name }}" \
-var="s3_bucket=${S3_INTEGRATION_BUCKET}" \
-var="vpc_security_group_ids=${VPC_SECURITY_GROUPS_IDS}" \
-var="key_name=${KEY_NAME}" \
-var="test_name=cw-integ-test-al2" \
-var="iam_instance_profile=${IAM_ROLE}" \
-var="github_sha_date=${{ steps.sha_date.outputs.sha_date }}" \
-var="test_dir=./integration/test/performancetest" ; then terraform destroy -auto-approve
Expand Down
41 changes: 22 additions & 19 deletions integration/terraform/ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,28 @@ for how to easily generate a new policy.
{
"Effect": "Allow",
"Action": [
"cloudwatch:GetMetricData",
"cloudwatch:PutMetricData",
"cloudwatch:ListMetrics",
"ec2:DescribeVolumes",
"ec2:DescribeTags",
"logs:PutLogEvents",
"logs:DescribeLogStreams",
"logs:DescribeLogGroups",
"logs:CreateLogStream",
"logs:CreateLogGroup",
"logs:DeleteLogGroup",
"logs:DeleteLogStream",
"logs:PutRetentionPolicy",
"logs:GetLogEvents",
"logs:PutLogEvents",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:ListBucket",
"ecr:GetAuthorizationToken"
"cloudwatch:GetMetricData",
"cloudwatch:PutMetricData",
"cloudwatch:ListMetrics",
"ec2:DescribeVolumes",
"ec2:DescribeTags",
"logs:PutLogEvents",
"logs:DescribeLogStreams",
"logs:DescribeLogGroups",
"logs:CreateLogStream",
"logs:CreateLogGroup",
"logs:DeleteLogGroup",
"logs:DeleteLogStream",
"logs:PutRetentionPolicy",
"logs:GetLogEvents",
"logs:PutLogEvents",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:ListBucket",
"ecr:GetAuthorizationToken",
"dynamodb:DescribeTable",
"dynamodb:PutItem",
"dynamodb:CreateTable"
],
"Resource": "*"
},
Expand Down
5 changes: 4 additions & 1 deletion integration/terraform/ec2/linux/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ data "aws_iam_policy_document" "user-managed-policy-document" {
"logs:PutLogEvents",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:ListBucket"
"s3:ListBucket",
"dynamodb:DescribeTable",
"dynamodb:PutItem",
"dynamodb:CreateTable"
]
resources = ["*"]
}
Expand Down
2 changes: 1 addition & 1 deletion integration/terraform/ec2/linux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ resource "null_resource" "integration_test" {
"cd ~/amazon-cloudwatch-agent",
"go test ./integration/test/sanity -p 1 -v --tags=integration",
"export SHA=${var.github_sha}",
"export SHA_DATE=${var.sha_date}",
"export SHA_DATE=${var.github_sha_date}",
"go test ${var.test_dir} -p 1 -v --tags=integration"
]
connection {
Expand Down

0 comments on commit dd61d0f

Please sign in to comment.