Skip to content

Commit

Permalink
add validation step
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolk committed Nov 28, 2023
1 parent 18acbd5 commit 4c16511
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
8 changes: 4 additions & 4 deletions codebuild_specs/release_workflows/rollback_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ batch:
buildspec: codebuild_specs/install_and_cache_dependencies.yml
env:
compute-type: BUILD_GENERAL1_LARGE
# - identifier: validate_cdk_version
# buildspec: codebuild_specs/validate_cdk_version.yml
# depend-on:
# - build_linux
- identifier: validate_rollback_target_version
buildspec: codebuild_specs/validate_rollback_target_version.yml
depend-on:
- install_dependencies
# - identifier: verify_yarn_lock
# buildspec: codebuild_specs/verify_yarn_lock.yml
# depend-on:
Expand Down
11 changes: 11 additions & 0 deletions codebuild_specs/validate_rollback_target_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 0.2
env:
shell: bash
phases:
build:
commands:
- source ./shared-scripts.sh && _validateRollbackTargetVersion

artifacts:
files:
- 'shared-scripts.sh'
11 changes: 11 additions & 0 deletions shared-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ function _testLinux {
# echo collecting coverage
# yarn coverage
}
function _validateRollbackTargetVersion {
echo Validate Rollback Target Version
# download [repo, .cache from s3]
loadCache repo $CODEBUILD_SRC_DIR
loadCache .cache $HOME/.cache
if [ -z "$ROLLBACK_TARGET_VERSION" ]; then
echo "Rollback target version is missing. Make sure CodeBuild workflow was started with ROLLBACK_TARGET_VERSION environment variable"
exit 1
fi
yarn ts-node scripts/verify-deployment.ts -v $ROLLBACK_TARGET_VERSION
}
function _validateCDKVersion {
echo Validate CDK Version
# download [repo, .cache from s3]
Expand Down

0 comments on commit 4c16511

Please sign in to comment.