summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-02-26 09:10:18 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2019-02-26 09:10:18 +0000
commitc3b176c5e3a344a48fb8eb0e7896f3b955bb9fd9 (patch)
treebca201bd39c5b1422fd44f9f9ecf2b1b90de344a
parented5ff8017ed2c4241dcb8dc94f7f9ba46e97a6b7 (diff)
parent9b2befb65b5ff6a6a00333366981eccf791f98f3 (diff)
downloadgitlab-ce-c3b176c5e3a344a48fb8eb0e7896f3b955bb9fd9.tar.gz
Merge branch '50313-use-kaniko-to-build-containers-in-autodevops' into 'master'
Use auto-build-image in AutoDevOps See merge request gitlab-org/gitlab-ce!24279
-rw-r--r--changelogs/unreleased/50313-use-kaniko-to-build-containers-in-autodevops.yml5
-rw-r--r--lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml52
2 files changed, 8 insertions, 49 deletions
diff --git a/changelogs/unreleased/50313-use-kaniko-to-build-containers-in-autodevops.yml b/changelogs/unreleased/50313-use-kaniko-to-build-containers-in-autodevops.yml
new file mode 100644
index 00000000000..0188df7fce7
--- /dev/null
+++ b/changelogs/unreleased/50313-use-kaniko-to-build-containers-in-autodevops.yml
@@ -0,0 +1,5 @@
+---
+title: Use auto-build-image for build job in Auto-DevOps.gitlab-ci.yml
+merge_request: 24279
+author:
+type: changed
diff --git a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
index 37fc1fccfb9..c0d4d4400b3 100644
--- a/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
@@ -74,12 +74,11 @@ stages:
build:
stage: build
- image: docker:stable-git
+ image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image/master:stable"
services:
- - docker:stable-dind
+ - docker:stable-dind
script:
- - setup_docker
- - build
+ - /build/build.sh
only:
- branches
@@ -491,7 +490,6 @@ rollout 100%:
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
- export CI_CONTAINER_NAME=ci_job_build_${CI_JOB_ID}
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/')
@@ -851,50 +849,6 @@ rollout 100%:
fi
}
- function build() {
- registry_login
-
- if [[ -f Dockerfile ]]; then
- echo "Building Dockerfile-based application..."
- docker build \
- --build-arg HTTP_PROXY="$HTTP_PROXY" \
- --build-arg http_proxy="$http_proxy" \
- --build-arg HTTPS_PROXY="$HTTPS_PROXY" \
- --build-arg https_proxy="$https_proxy" \
- --build-arg FTP_PROXY="$FTP_PROXY" \
- --build-arg ftp_proxy="$ftp_proxy" \
- --build-arg NO_PROXY="$NO_PROXY" \
- --build-arg no_proxy="$no_proxy" \
- -t "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" .
- else
- echo "Building Heroku-based application using gliderlabs/herokuish docker image..."
- docker run -i \
- -e BUILDPACK_URL \
- -e HTTP_PROXY \
- -e http_proxy \
- -e HTTPS_PROXY \
- -e https_proxy \
- -e FTP_PROXY \
- -e ftp_proxy \
- -e NO_PROXY \
- -e no_proxy \
- --name="$CI_CONTAINER_NAME" -v "$(pwd):/tmp/app:ro" gliderlabs/herokuish /bin/herokuish buildpack build
- docker commit "$CI_CONTAINER_NAME" "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG"
- docker rm "$CI_CONTAINER_NAME" >/dev/null
- echo ""
-
- echo "Configuring $CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG docker image..."
- docker create --expose 5000 --env PORT=5000 --name="$CI_CONTAINER_NAME" "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" /bin/herokuish procfile start web
- docker commit "$CI_CONTAINER_NAME" "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG"
- docker rm "$CI_CONTAINER_NAME" >/dev/null
- echo ""
- fi
-
- echo "Pushing to GitLab Container Registry..."
- docker push "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG"
- echo ""
- }
-
function initialize_tiller() {
echo "Checking Tiller..."