-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update jsonnet libs and add rollback pipeline (#2301)
- Loading branch information
1 parent
693bcb8
commit de43130
Showing
9 changed files
with
75 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
format_version: 10 | ||
pipelines: | ||
rollback-relay-next: | ||
display_order: 1 | ||
environment_variables: | ||
ALL_PIPELINE_FLAGS: --pipeline="deploy-relay-next-monitor" --pipeline="deploy-relay-next-us" --pipeline="deploy-relay-next" | ||
GOCD_ACCESS_TOKEN: '{{SECRET:[devinfra][gocd_access_token]}}' | ||
REGION_PIPELINE_FLAGS: --pipeline="deploy-relay-next-monitor" --pipeline="deploy-relay-next-us" | ||
ROLLBACK_MATERIAL_NAME: relay_repo | ||
ROLLBACK_STAGE: deploy-production | ||
group: relay-next | ||
lock_behavior: unlockWhenFinished | ||
materials: | ||
deploy-relay-next-us-pipeline-complete: | ||
pipeline: deploy-relay-next-us | ||
stage: pipeline-complete | ||
stages: | ||
- pause_pipelines: | ||
approval: | ||
type: manual | ||
jobs: | ||
rollback: | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
## Note: $ALL_PIPELINE_FLAGS has no quoting, for word expansion | ||
## shellcheck disable=SC2086 | ||
if [[ "${ALL_PIPELINE_FLAGS:-}" ]]; then | ||
set -- $ALL_PIPELINE_FLAGS | ||
fi | ||
## Pause all pipelines in the pipedream | ||
gocd-pause-and-cancel-pipelines \ | ||
--pause-message="This pipeline is being rolled back, please check with team before un-pausing." \ | ||
"$@" | ||
start_rollback: | ||
jobs: | ||
rollback: | ||
tasks: | ||
- script: | | ||
##!/bin/bash | ||
## Note: $REGION_PIPELINE_FLAGS has no quoting, for word expansion | ||
## shellcheck disable=SC2086 | ||
if [[ "${REGION_PIPELINE_FLAGS:-}" ]]; then | ||
set -- $REGION_PIPELINE_FLAGS | ||
fi | ||
## Get sha from the given pipeline run to deploy to all pipedream pipelines. | ||
sha=$(gocd-sha-for-pipeline --material-name="${ROLLBACK_MATERIAL_NAME}") | ||
gocd-emergency-deploy \ | ||
--commit-sha="${sha}" \ | ||
--deploy-stage="${ROLLBACK_STAGE}" \ | ||
--pause-message="This pipeline was rolled back, please check with team before un-pausing." \ | ||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters