From e51436239452e50748596c7edf44e0fc4970c439 Mon Sep 17 00:00:00 2001 From: Antoine Legrand <2t.antoine@gmail.com> Date: Mon, 26 Jun 2017 15:21:59 +0200 Subject: [PATCH] use-docker host dns for CI --- .gitlab-ci.jsonnet | 1 + .gitlab-ci.yml | 21 +++++++++------------ .gitlab-ci/base_jobs.libsonnet | 10 +++++----- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.jsonnet b/.gitlab-ci.jsonnet index 38303cfd6..7b4f63fff 100644 --- a/.gitlab-ci.jsonnet +++ b/.gitlab-ci.jsonnet @@ -13,6 +13,7 @@ local stages_list = [ 'docker_release', 'teardown', ]; + local stages = utils.set(stages_list); // List CI jobs diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5374fd23c..6f71be9be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,13 +11,12 @@ container-base-build: script: - docker build --cache-from quay.io/quay/quay-base:latest -t quay.io/quay/quay-base:latest -f quay-base.dockerfile . - docker push quay.io/quay/quay-base:latest - services: - - docker:dind stage: docker_base tags: - - docker + - kubernetes variables: - DOCKER_DRIVER: aufs + DOCKER_DRIVER: overlay + DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 container-build: before_script: - docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io @@ -25,13 +24,12 @@ container-build: script: - docker build -t quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} -f quay.dockerfile . - docker push quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} - services: - - docker:dind stage: docker_build tags: - - docker + - kubernetes variables: - DOCKER_DRIVER: aufs + DOCKER_DRIVER: overlay + DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 container-release: before_script: - docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io @@ -43,13 +41,12 @@ container-release: - docker pull quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} - docker tag quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA} - docker push quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA} - services: - - docker:dind stage: docker_release tags: - - docker + - kubernetes variables: - DOCKER_DRIVER: aufs + DOCKER_DRIVER: overlay + DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 karma-tests: before_script: - cd / diff --git a/.gitlab-ci/base_jobs.libsonnet b/.gitlab-ci/base_jobs.libsonnet index d45227087..85eb5dcf0 100644 --- a/.gitlab-ci/base_jobs.libsonnet +++ b/.gitlab-ci/base_jobs.libsonnet @@ -3,17 +3,17 @@ function(vars={}) dockerBuild: { // base job to manage containers (build / push) variables: { - DOCKER_DRIVER: "aufs", + DOCKER_DRIVER: "overlay", + DOCKER_HOST: "tcp://docker-host.gitlab-runner.svc.cluster.local:2375" }, + image: "docker:git", before_script: [ "docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io", ], - services: [ - "docker:dind", - ], + tags: [ - "docker", + "kubernetes", ], },