Loading .gitlab-ci.yml +20 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,26 @@ test-persist-environment-url: - persist_environment_url - grep review-app.example.com environment_url.txt test-deploy-name: stage: test image: "$BUILD_IMAGE_NAME" variables: CI_ENVIRONMENT_SLUG: production script: - source /build/deploy-helpers.sh - name=$(deploy_name "stable") - | if [[ $name != "production" ]]; then echo "$name should equal 'production'" exit 1 fi - name=$(deploy_name "canary") - | if [[ $name != "production-canary" ]]; then echo "$name should equal 'production-canary'" exit 1 fi before_script: - | function expected_error() { Loading src/deploy-helpers.sh +13 −0 Original line number Diff line number Diff line Loading @@ -75,3 +75,16 @@ function create_secret() { function persist_environment_url() { echo $CI_ENVIRONMENT_URL > environment_url.txt } ## Helper functions function deploy_name() { name="$CI_ENVIRONMENT_SLUG" track="${1-stable}" if [[ "$track" != "stable" ]]; then name="$name-$track" fi echo $name } Loading
.gitlab-ci.yml +20 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,26 @@ test-persist-environment-url: - persist_environment_url - grep review-app.example.com environment_url.txt test-deploy-name: stage: test image: "$BUILD_IMAGE_NAME" variables: CI_ENVIRONMENT_SLUG: production script: - source /build/deploy-helpers.sh - name=$(deploy_name "stable") - | if [[ $name != "production" ]]; then echo "$name should equal 'production'" exit 1 fi - name=$(deploy_name "canary") - | if [[ $name != "production-canary" ]]; then echo "$name should equal 'production-canary'" exit 1 fi before_script: - | function expected_error() { Loading
src/deploy-helpers.sh +13 −0 Original line number Diff line number Diff line Loading @@ -75,3 +75,16 @@ function create_secret() { function persist_environment_url() { echo $CI_ENVIRONMENT_URL > environment_url.txt } ## Helper functions function deploy_name() { name="$CI_ENVIRONMENT_SLUG" track="${1-stable}" if [[ "$track" != "stable" ]]; then name="$name-$track" fi echo $name }