Commit a795b205 authored by Kamal Dodiya's avatar Kamal Dodiya
Browse files

Add template file and include in main ci

parent 8d56ec48
Pipeline #172558 failed
stages:
- build
- deploy
variables:
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}
DOCKER_TLS_CERTDIR: ""
.build:
stage: build
image: docker
services:
- docker:dind
include: 'gitlab-ci-templates/basic-templates.yml'
Docker:
extends: .build
Review:HX:
extends: .deploy
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- cd k8s/overlays/review
- kustomize edit set label environment:${CI_COMMIT_REF_SLUG}
- kustomize edit set image DOCKER_IMAGE:${DOCKER_IMAGE}
script:
- docker build -t ${DOCKER_IMAGE} --no-cache .
- docker push ${DOCKER_IMAGE}
- docker rmi ${DOCKER_IMAGE}
- docker logout $CI_REGISTRY
- kustomize build .
except:
- master
Dev:HX:
extends: .deploy
before_script:
- cd k8s/overlays/dev
only:
- master
Docker:
extends: .build
Staging:HX:
extends: .deploy
environment:
name : wp-hx-staging
before_script:
- cd k8s/overlays/staging
only:
- master
Staging:HL:
extends: .deploy
environment:
name : wp-hh-staging
before_script:
- cd k8s/overlays/staging
only:
- master
Internal:HX:
extends: .deploy
environment:
name : wp-hx-internal
before_script:
- cd k8s/overlays/internal
only:
- master
Internal:HL:
extends: .deploy
environment:
name : wp-hh-internal
before_script:
- cd k8s/overlays/internal
only:
- master
Production:HX:
extends: .deploy
environment:
name : wp-hx-live
before_script:
- cd k8s/overlays/production
only:
- master
Production:HL:
extends: .deploy
environment:
name : wp-hh-live
before_script:
- cd k8s/overlays/production
only:
- master
.build:
stage: build
image: docker
services:
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build -t ${DOCKER_IMAGE} --no-cache .
- docker push ${DOCKER_IMAGE}
- docker rmi ${DOCKER_IMAGE}
- docker logout $CI_REGISTRY
.deploy:
stage: deploy
image: dockerhub.ebi.ac.uk/ensembl-web/deploy-tools:0.4
before_script:
- cd k8s/base
script:
- kustomize edit set image DOCKER_IMAGE=${DOCKER_IMAGE}
- kustomize build . | kubectl apply -f -
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment