-
Cyril Christophe Daniel Robert Cros authoredCyril Christophe Daniel Robert Cros authored
.gitlab-ci.yml 3.05 KiB
---
variables:
S3_ENDPOINT: "https://s3.embl.de"
S3_BUCKET: "annelids"
JBROWSE_HOSTNAME: "genomes-testing.arendt.embl.de"
RELEASE_LABEL: "testing"
INGRESS_CLASS: "internal-users"
stages:
- access_test
- build_container
- deploy_to_cluster
- clean_up_on_failure
cluster_access_test:
image: dtzar/helm-kubectl:3.8.2
stage: access_test
before_script:
- cd deployment
- echo $KUBECONFIG | base64 -d > /tmp/kubeconf
- export KUBECONFIG=/tmp/kubeconf
script:
- kubectl config current-context
build_nginx_with_jbrowse_config_file:
image: gcr.io/kaniko-project/executor:debug-v0.21.0
stage: build_container
before_script:
# yamllint disable-line rule:line-length
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --cache=true --context $CI_PROJECT_DIR/image
--dockerfile $CI_PROJECT_DIR/image/Dockerfile
--destination $CI_REGISTRY_IMAGE:jbrowse2-$CI_COMMIT_SHORT_SHA
- echo "Destination follows"
- echo $CI_REGISTRY_IMAGE:jbrowse2-$CI_COMMIT_SHORT_SHA
kustomize_build_apply:
image: dtzar/helm-kubectl:3.8.2
stage: deploy_to_cluster
before_script:
- echo $KUBECONFIG | base64 -d > /tmp/kubeconf
- export KUBECONFIG=/tmp/kubeconf
script:
- echo "You are on branch $CI_COMMIT_REF_NAME"
- envsubst < deployment/jbrowse2-dep.yml > deployment/jbrowse2-dep.yaml
- cat deployment/jbrowse2-dep.yaml
- kubectl apply -k deployment
- kubectl -n $NS rollout restart deployment/jbrowse2-$RELEASE_LABEL
- kubectl -n $NS wait --for=condition=available
--timeout=60s deploy/jbrowse2-$RELEASE_LABEL
- kubectl -n $NS rollout status deployment/jbrowse2-$RELEASE_LABEL
dependencies:
- cluster_access_test
- build_nginx_with_jbrowse_config_file
rules:
- if: '$CI_COMMIT_REF_NAME == "main"'
variables:
JBROWSE_HOSTNAME: "genomes.arendt.embl.de"
RELEASE_LABEL: "prod"
INGRESS_CLASS: "external-users"
- if: '$CI_COMMIT_REF_NAME == "dev"'
variables:
JBROWSE_HOSTNAME: "genomes-dev.arendt.embl.de"
RELEASE_LABEL: "dev"
INGRESS_CLASS: "internal-users"
- when: on_success
clean_up_k8s_deployment:
image: dtzar/helm-kubectl:3.8.2