|
1 | 1 | local utils = import '../libs/utils.libsonnet'; |
2 | 2 | local gocdtasks = import 'github.com/getsentry/gocd-jsonnet/libs/gocd-tasks.libsonnet'; |
3 | 3 |
|
| 4 | +local deploy_canary(region) = [ |
| 5 | + { |
| 6 | + 'deploy-canary': { |
| 7 | + fetch_materials: true, |
| 8 | + jobs: { |
| 9 | + create_sentry_release: { |
| 10 | + environment_variables: { |
| 11 | + SENTRY_ORG: 'sentry', |
| 12 | + SENTRY_PROJECT: 'objectstore', |
| 13 | + SENTRY_AUTH_TOKEN: '{{SECRET:[devinfra-sentryio][token]}}', |
| 14 | + SENTRY_ENVIRONMENT: region + '-canary', |
| 15 | + }, |
| 16 | + timeout: 60, |
| 17 | + elastic_profile_id: 'objectstore', |
| 18 | + tasks: [ |
| 19 | + gocdtasks.script(importstr '../bash/create-sentry-release.sh'), |
| 20 | + ], |
| 21 | + }, |
| 22 | + deploy: { |
| 23 | + timeout: 300, |
| 24 | + elastic_profile_id: 'objectstore', |
| 25 | + environment_variables: { |
| 26 | + K8S_ENVIRONMENT: 'canary', |
| 27 | + PAUSE_MESSAGE: 'Pausing pipeline due to canary failure.', |
| 28 | + }, |
| 29 | + tasks: [ |
| 30 | + gocdtasks.script(importstr '../bash/deploy.sh'), |
| 31 | + gocdtasks.script(importstr '../bash/wait-canary.sh'), |
| 32 | + // TODO: Add sentry error checks |
| 33 | + // TODO: Add datadog monitors |
| 34 | + utils.pause_on_failure(), |
| 35 | + ], |
| 36 | + }, |
| 37 | + }, |
| 38 | + }, |
| 39 | + }, |
| 40 | +]; |
| 41 | + |
4 | 42 | local deploy_primary(region) = [ |
5 | 43 | { |
6 | 44 | 'deploy-primary': { |
@@ -45,5 +83,5 @@ function(region) { |
45 | 83 | destination: 'objectstore', |
46 | 84 | }, |
47 | 85 | }, |
48 | | - stages: utils.github_checks() + deploy_primary(region), |
| 86 | + stages: utils.github_checks() + deploy_canary(region) + deploy_primary(region), |
49 | 87 | } |
0 commit comments