summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-09-13 12:19:53 +1200
committerThong Kuah <tkuah@gitlab.com>2018-09-13 12:37:06 +1200
commit97ad3f91784b0cce18bc3d1484fca3e5d08547c3 (patch)
treebe9a38789739eb8e9a39f55cc17d878de7e53c11 /vendor
parentf87809f78de9da04f38134ba5ce0cf9ddebf2f63 (diff)
downloadgitlab-ce-97ad3f91784b0cce18bc3d1484fca3e5d08547c3.tar.gz
Created a function for logging into the registry
Vendor Auto-DevOps.gitlab-ci.yml from https://gitlab.com/gitlab-org/gitlab-ci-yml/merge_requests/193 Thanks @LaurentGoderre, for your contribution !
Diffstat (limited to 'vendor')
-rw-r--r--vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml12
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml b/vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
index 0b362fa0bee..1c488b040f2 100644
--- a/vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
+++ b/vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
@@ -451,12 +451,16 @@ rollout 100%:
# 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/')
- function container_scanning() {
+ function registry_login() {
if [[ -n "$CI_REGISTRY_USER" ]]; then
echo "Logging to GitLab Container Registry with CI credentials..."
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
echo ""
fi
+ }
+
+ function container_scanning() {
+ registry_login
docker run -d --name db arminc/clair-db:latest
docker run -p 6060:6060 --link db:postgres -d --name clair --restart on-failure arminc/clair-local-scan:v2.0.1
@@ -700,11 +704,7 @@ rollout 100%:
}
function build() {
- if [[ -n "$CI_REGISTRY_USER" ]]; then
- echo "Logging to GitLab Container Registry with CI credentials..."
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- echo ""
- fi
+ registry_login
if [[ -f Dockerfile ]]; then
echo "Building Dockerfile-based application..."