From 9dcf3b682858bd43d1f6d7063b3abb2604d1b826 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Tue, 1 Jan 2019 11:30:28 +0100 Subject: [PATCH] Update build pipeline --- .gitlab-ci.yml | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8171ef9..36bbdba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ stages: variables: DOCKER_HOST: tcp://docker:2375/ -image: registry.gitlab.com/sparetimecoder/build-tools +image: registry.gitlab.com/sparetimecoders/build-tools build: stage: build @@ -13,33 +13,14 @@ build: services: - docker:dind script: - - docker version - - docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:latest . - - docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - - docker push $CI_REGISTRY_IMAGE:latest - -.deploy: &deploy_template - before_script: - - mkdir -p ~/.kube - - echo ${KUBECONFIG_CONTENT} | base64 -d > ~/.kube/config - - kubectl config get-contexts - - | - cat < .buildtools - declare -A valid_environments - valid_environments=( - ["staging"]="--context k8s.unbound.se --namespace staging" - ["prod"]="--context k8s.unbound.se --namespace default" - ) - EOF + - build + - push deploy-to-prod: - <<: *deploy_template stage: deploy-prod when: on_success script: - - echo Deploy Angus to PROD. + - echo Deploy to PROD. - deploy prod environment: name: prod