-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
32 lines (30 loc) · 1.91 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
stages:
- deploy
variables:
AWS_MAX_ATTEMPTS: 5 # retry AWS operations 5 times if they fail on network errors
DATADOG_AGENT_BUILDERS: v9930706-ef9d493
S3_CP_CMD: aws s3 cp --only-show-errors --region us-east-1 --sse AES256
SCRIPT_VERSION: 5
deploy:
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/gitlab_agent_deploy:$DATADOG_AGENT_BUILDERS
tags: ["arch:amd64"]
stage: deploy
rules:
- when: manual
script:
- sha256sum ./install_test_visibility.sh > install_test_visibility_v${SCRIPT_VERSION}.sh.sha256sum
- $S3_CP_CMD ./install_test_visibility.sh s3://dd-agent/scripts/install_test_visibility_v${SCRIPT_VERSION}.sh --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=id=3a6e02b08553fd157ae3fb918945dd1eaae5a1aa818940381ef07a430cf25732
- $S3_CP_CMD ./install_test_visibility_v${SCRIPT_VERSION}.sh.sha256sum s3://dd-agent/scripts/install_test_visibility_v${SCRIPT_VERSION}.sh.sha256sum --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=id=3a6e02b08553fd157ae3fb918945dd1eaae5a1aa818940381ef07a430cf25732
after_script:
# invalidate the install.datadoghq.com CF distribution
- export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s"
$(aws --region "us-east-1" sts assume-role
--duration-seconds 900
--role-arn "arn:aws:iam::464622532012:role/build-stable-cloudfront-invalidation"
--role-session-name "build-stable-cloudfront-invalidate-script"
--query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]"
--output text
)
)
- aws --region "us-east-1" cloudfront create-invalidation --distribution-id "E2VSER0FO39KRV" --paths "/scripts/install_test_visibility_v${SCRIPT_VERSION}.sh"
- aws --region "us-east-1" cloudfront create-invalidation --distribution-id "E2VSER0FO39KRV" --paths "/scripts/install_test_visibility_v${SCRIPT_VERSION}.sh.sha256sum"