Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2019-03-07 11:55:24 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-03-07 11:55:24 +0300
commit80fea82f3ab6afd486884020710eb01c06b048d9 (patch)
tree399dcb4f0f5c8e8785038532626d3f9e26261f4e
parentcd34e4817afee2d2777a3470049b921a6d3fc36d (diff)
parentf6d90ccfb57fc0f1b76747eb961acb21a6632910 (diff)
Merge branch 'auto-devops-tags' into 'master'
Add Auto DevOps build job for tags See merge request gitlab-org/gitlab-ce!25718
-rw-r--r--changelogs/unreleased/auto-devops-tags.yml5
-rw-r--r--doc/topics/autodevops/index.md2
-rw-r--r--lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml20
3 files changed, 24 insertions, 3 deletions
diff --git a/changelogs/unreleased/auto-devops-tags.yml b/changelogs/unreleased/auto-devops-tags.yml
new file mode 100644
index 00000000000..1b96d457776
--- /dev/null
+++ b/changelogs/unreleased/auto-devops-tags.yml
@@ -0,0 +1,5 @@
+---
+title: Adds Auto DevOps build job for tags
+merge_request: 25718
+author: walkafwalka
+type: added
diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md
index 2e1df9d50d4..195dd3e8846 100644
--- a/doc/topics/autodevops/index.md
+++ b/doc/topics/autodevops/index.md
@@ -291,7 +291,7 @@ Auto Build creates a build of the application using an existing `Dockerfile` or
Heroku buildpacks.
Either way, the resulting Docker image is automatically pushed to the
-[Container Registry][container-registry] and tagged with the commit SHA.
+[Container Registry][container-registry] and tagged with the commit SHA or tag.
#### Auto Build using a Dockerfile
diff --git a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
index c0d4d4400b3..6c99e20e7af 100644
--- a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
@@ -81,6 +81,7 @@ build:
- /build/build.sh
only:
- branches
+ - tags
test:
services:
@@ -95,6 +96,7 @@ test:
- /bin/herokuish buildpack test
only:
- branches
+ - tags
except:
variables:
- $TEST_DISABLED
@@ -112,6 +114,7 @@ code_quality:
paths: [gl-code-quality-report.json]
only:
- branches
+ - tags
except:
variables:
- $CODE_QUALITY_DISABLED
@@ -129,6 +132,7 @@ license_management:
only:
refs:
- branches
+ - tags
variables:
- $GITLAB_FEATURES =~ /\blicense_management\b/
except:
@@ -151,6 +155,7 @@ performance:
only:
refs:
- branches
+ - tags
kubernetes: active
except:
variables:
@@ -171,6 +176,7 @@ sast:
only:
refs:
- branches
+ - tags
variables:
- $GITLAB_FEATURES =~ /\bsast\b/
except:
@@ -192,6 +198,7 @@ dependency_scanning:
only:
refs:
- branches
+ - tags
variables:
- $GITLAB_FEATURES =~ /\bdependency_scanning\b/
except:
@@ -212,6 +219,7 @@ container_scanning:
only:
refs:
- branches
+ - tags
variables:
- $GITLAB_FEATURES =~ /\bcontainer_scanning\b/
except:
@@ -231,6 +239,7 @@ dast:
only:
refs:
- branches
+ - tags
kubernetes: active
variables:
- $GITLAB_FEATURES =~ /\bdast\b/
@@ -260,6 +269,7 @@ review:
only:
refs:
- branches
+ - tags
kubernetes: active
except:
refs:
@@ -283,6 +293,7 @@ stop_review:
only:
refs:
- branches
+ - tags
kubernetes: active
except:
refs:
@@ -488,8 +499,13 @@ rollout 100%:
[[ "$TRACE" ]] && set -x
auto_database_url=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${CI_ENVIRONMENT_SLUG}-postgres:5432/${POSTGRES_DB}
export DATABASE_URL=${DATABASE_URL-$auto_database_url}
- export CI_APPLICATION_REPOSITORY=$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG
- export CI_APPLICATION_TAG=$CI_COMMIT_SHA
+ if [[ -z "$CI_COMMIT_TAG" ]]; then
+ export CI_APPLICATION_REPOSITORY=$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG
+ export CI_APPLICATION_TAG=$CI_COMMIT_SHA
+ else
+ export CI_APPLICATION_REPOSITORY=$CI_REGISTRY_IMAGE
+ export CI_APPLICATION_TAG=$CI_COMMIT_TAG
+ fi
export TILLER_NAMESPACE=$KUBE_NAMESPACE
# Extract "MAJOR.MINOR" from CI_SERVER_VERSION and generate "MAJOR-MINOR-stable" for Security Products
export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')