Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ stages:
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}
BASE: k8s/base
BASE: ensembl-k8s-manifests/ensembl-web-resolver
NFS_SERVER: ${HL_NFS_SERVER_CODON}
NFS_PATH: ${HL_NFS_PATH_CODON}

# Template to build docker image
.build:
Expand All @@ -29,22 +31,23 @@ variables:
- docker logout $CI_REGISTRY

rules:
- if: '$CI_DEPLOY_FREEZE == null'
- if: "$CI_DEPLOY_FREEZE == null"

.deploy:
stage: deploy
image: dockerhub.ebi.ac.uk/ensembl-web/deploy-tools:latest
before_script:
- kubectl config use-context ${AGENT}
- kubectl config set-context --current --namespace=${NS}
- kubectl config set-context --current --namespace=${NS}
script:
- git clone https://gitlab.ebi.ac.uk/ensembl-web/ensembl-k8s-manifests.git
- git -C ensembl-k8s-manifests/ checkout k8s123-migration
- sed -i "s#<NFS_SERVER>#${NFS_SERVER}#g" ${BASE}/deployment.yaml
- sed -i "s#<NFS_PATH>#${NFS_PATH}#g" ${BASE}/deployment.yaml
- cd ensembl-k8s-manifests/ensembl-web-resolver
- kustomize edit set image DOCKER_IMAGE=${DOCKER_IMAGE}
- kubectl apply -k ./


.deploy_rules:
rules:
- if: '$CI_DEPLOY_FREEZE == null && $CI_COMMIT_BRANCH == "main"'
Expand All @@ -66,8 +69,6 @@ Prod:
AGENT: ${PROD_AGENT}
NS: ${PROD_NS}



# Setup Review app in its own namespace named by branch name (CI_COMMIT_REF_SLUG)
Setup:Review:
stage: setup
Expand All @@ -78,9 +79,9 @@ Setup:Review:
- kubectl create namespace ${CI_COMMIT_REF_SLUG} --dry-run=client -o yaml | kubectl apply -f -
- kubectl create configmap metadata-api-configmap --from-env-file=.env.sample --dry-run=client -o yaml | kubectl apply -f -
rules:
- if: $CI_PIPELINE_SOURCE == "push" &&
$CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000" &&
$CI_COMMIT_REF_NAME !~ "/^nodeploy\/.*$/"
- if: $CI_PIPELINE_SOURCE == "push" &&
$CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000" &&
$CI_COMMIT_REF_NAME !~ "/^nodeploy\/.*$/"
when: always

# Run Tests
Expand Down Expand Up @@ -115,7 +116,7 @@ Review:

#Prod:WP41:HX:
Fallback:
extends:
extends:
- .deploy
- .deploy_rules
environment:
Expand All @@ -124,14 +125,13 @@ Fallback:
AGENT: ${FALLABACK_AGENT}
NS: ${FALLBACK_NS}


# Dev: dev-2020.ensembl.org
Dev:
extends:
extends:
- .deploy
- .deploy_rules
environment:
name: development
variables:
variables:
AGENT: ${DEV_AGENT}
NS: ${DEV_NS}
Loading