-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathdeploy_invalidate.yml
30 lines (27 loc) · 1.28 KB
/
deploy_invalidate.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
---
# deploy_invalidate stage
# Contains jobs which automatically invalidate Cloudfront distributions when packages are deployed
# to the staging repsositories.
#
# Cloudfront cache invalidation:
# Duplicated in 2 jobs: one that runs "on success" of the previous stage, and one that runs "on failure" of previous stages.
# Compared to having 1 single job that runs "always", this setup guarantees that if earlier stages first failed and were
# then retried successfully, the cloudfront invalidation will also run after the successful retry.
#
.deploy_cloudfront_invalidate:
stage: deploy_invalidate
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/gitlab_agent_deploy:$DATADOG_AGENT_BUILDERS
tags: ["runner:main"]
dependencies: []
script:
- cd /deploy_scripts/cloudfront-invalidation
- "REPO=apt RUNNER_ENV=build-stable REPO_ENV=staging PATTERN_SUBSTRING=/$DEB_RPM_BUCKET_BRANCH/ ./invalidate.sh"
- "REPO=yum RUNNER_ENV=build-stable REPO_ENV=staging PATTERN_SUBSTRING=/$DEB_RPM_BUCKET_BRANCH/ ./invalidate.sh"
deploy_cloudfront_invalidate_on_success:
extends: .deploy_cloudfront_invalidate
rules:
!reference [.on_deploy]
deploy_cloudfront_invalidate_on_failure:
extends: .deploy_cloudfront_invalidate
rules:
!reference [.on_deploy_failure]