summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-09-27 15:06:02 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2018-09-27 15:10:48 +0300
commitdf796a421298355710fa4422de7ac0b69362b1a6 (patch)
tree254f8526a545920f36b24df8930b632555d05a25
parent7c1cfd0bf5fd394e0e4387e350d69767aa873f84 (diff)
downloadgitlab-ce-df796a421298355710fa4422de7ac0b69362b1a6.tar.gz
Dont create license_management build when not included in license4907-improve-build-create-performance-for-license-management
This improves CI performance since we do not create a whole new job that just exits quickly. This is important based on https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/4907#note_104742212
-rw-r--r--changelogs/unreleased/4907-improve-build-create-performance-for-license-management.yml5
-rw-r--r--lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml15
2 files changed, 12 insertions, 8 deletions
diff --git a/changelogs/unreleased/4907-improve-build-create-performance-for-license-management.yml b/changelogs/unreleased/4907-improve-build-create-performance-for-license-management.yml
new file mode 100644
index 00000000000..e82bda6819f
--- /dev/null
+++ b/changelogs/unreleased/4907-improve-build-create-performance-for-license-management.yml
@@ -0,0 +1,5 @@
+---
+title: Dont create license_management build when not included in license
+merge_request: 21958
+author:
+type: performance
diff --git a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
index e3a2534e97a..d8fcdfac266 100644
--- a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
@@ -122,6 +122,9 @@ license_management:
paths: [gl-license-management-report.json]
only:
- branches
+ only:
+ variables:
+ - $GITLAB_FEATURES =~ /\blicense_management\b/
except:
variables:
- $LICENSE_MANAGEMENT_DISABLED
@@ -484,15 +487,11 @@ rollout 100%:
}
function license_management() {
- if echo $GITLAB_FEATURES |grep license_management > /dev/null ; then
- # Extract "MAJOR.MINOR" from CI_SERVER_VERSION and generate "MAJOR-MINOR-stable"
- LICENSE_MANAGEMENT_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
+ # Extract "MAJOR.MINOR" from CI_SERVER_VERSION and generate "MAJOR-MINOR-stable"
+ LICENSE_MANAGEMENT_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run --volume "$PWD:/code" \
- "registry.gitlab.com/gitlab-org/security-products/license-management:$LICENSE_MANAGEMENT_VERSION" analyze /code
- else
- echo "License management is not available in your subscription"
- fi
+ docker run --volume "$PWD:/code" \
+ "registry.gitlab.com/gitlab-org/security-products/license-management:$LICENSE_MANAGEMENT_VERSION" analyze /code
}
function sast() {