diff options
author | Ian Baum <ibaum@gitlab.com> | 2018-11-14 11:36:02 -0600 |
---|---|---|
committer | Ian Baum <ibaum@gitlab.com> | 2018-11-14 11:36:58 -0600 |
commit | 451303a56e5b805984dc4be6f0e0e2ad2093908c (patch) | |
tree | e1bc9170a749fe3ec431c11685c4f3882fa71557 | |
parent | 51c09c381b98d55a70c54c0ca709161dd75e808d (diff) | |
download | gitlab-ce-conditionally-build-assets-image.tar.gz |
Add BUILD_ASSETS_IMAGE CI variableconditionally-build-assets-image
* Defaults to TRUE
* Can be used to disable building/pushing the assets image in the
gitlab:compile:assets job
-rw-r--r-- | .gitlab-ci.yml | 1 | ||||
-rwxr-xr-x | scripts/build_assets_image | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94922aec598..d7b0ec5c9dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,7 @@ variables: GET_SOURCES_ATTEMPTS: "3" KNAPSACK_RSPEC_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/rspec_report-master.json FLAKY_RSPEC_SUITE_REPORT_PATH: rspec_flaky/report-suite.json + BUILD_ASSETS_IMAGE: "true" before_script: - bundle --version diff --git a/scripts/build_assets_image b/scripts/build_assets_image index 1d77524d503..4e5ef977161 100755 --- a/scripts/build_assets_image +++ b/scripts/build_assets_image @@ -1,5 +1,11 @@ #!/bin/bash +# Exit early if we don't want to build the image +if [[ "${BUILD_ASSETS_IMAGE}" != "true" ]] +then + exit 0 +fi + # Generate the image name based on the project this is being run in ASSETS_IMAGE_NAME=$(echo ${CI_PROJECT_NAME} | awk '{ |