.gitlab-ci.yml 4.11 KB
Newer Older
Kamal Dodiya's avatar
Kamal Dodiya committed
1 2 3
stages:
  - deploy

Kamal Dodiya's avatar
Kamal Dodiya committed
4 5 6 7
variables:
  BROWSER_SERVICE_SLUG: dev
  GENOME_SEARCH_SERVICE_SLUG: dev
  THOAS_SERVICE_SLUG: dev
Kamal Dodiya's avatar
Kamal Dodiya committed
8
  REFGET_SERVICE_SLUG: dev
Kamal Dodiya's avatar
Kamal Dodiya committed
9
  HELP_DOCS_SERVICE_SLUG: dev
Kamal Dodiya's avatar
Kamal Dodiya committed
10

Kamal Dodiya's avatar
Kamal Dodiya committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
.deploy:
  stage: deploy
  image: dockerhub.ebi.ac.uk/kamal/deploy-tools:0.2

  before_script:
    - SERVICE_TAG=`yq r values.yaml fe-services.client-service`
    - if [ "${SERVICE_TAG}" == "<BRANCH_NAME>" ] ; then echo "Please sepcify <BRANCH_NAME> for FE services" ; exit 1 ; fi
    - SERVICE_TAG="${SERVICE_TAG//[[:space:]]/}"
    - SERVICE_SLUG="${SERVICE_TAG//[^[:alnum:]]/-}"
    - BROWSER_SERVICE_TAG=`yq r values.yaml be-services.browser-service`
    - BROWSER_SERVICE_TAG="${BROWSER_SERVICE_TAG//[[:space:]]/}"
    - BROWSER_SERVICE_SLUG="${BROWSER_SERVICE_TAG//[^[:alnum:]]/-}"
    - GENOME_SEARCH_SERVICE_TAG=`yq r values.yaml be-services.genome-search-service`
    - GENOME_SEARCH_SERVICE_TAG="${GENOME_SEARCH_SERVICE_TAG//[[:space:]]/}"
    - GENOME_SEARCH_SERVICE_SLUG="${GENOME_SEARCH_SERVICE_TAG//[^[:alnum:]]/-}"
Kamal Dodiya's avatar
Kamal Dodiya committed
26 27 28
    - THOAS_SERVICE_TAG=`yq r values.yaml be-services.thoas-service`
    - THOAS_SERVICE_TAG="${THOAS_SERVICE_TAG//[[:space:]]/}"
    - THOAS_SERVICE_SLUG="${THOAS_SERVICE_TAG//[^[:alnum:]]/-}"
Kamal Dodiya's avatar
Kamal Dodiya committed
29 30 31
    - REFGET_SERVICE_TAG=`yq r values.yaml be-services.refget-service`
    - REFGET_SERVICE_TAG="${REFGET_SERVICE_TAG//[[:space:]]/}"
    - REFGET_SERVICE_SLUG="${REFGET_SERVICE_TAG//[^[:alnum:]]/-}"
Kamal Dodiya's avatar
Kamal Dodiya committed
32 33 34
    - HELP_DOCS_SERVICE_TAG=`yq r values.yaml be-services.help-docs-service`
    - HELP_DOCS_SERVICE_TAG="${HELP_DOCS_SERVICE_TAG//[[:space:]]/}"
    - HELP_DOCS_SERVICE_SLUG="${HELP_DOCS_SERVICE_TAG//[^[:alnum:]]/-}"
Kamal Dodiya's avatar
Kamal Dodiya committed
35
    # ensembl-client
Kamal Dodiya's avatar
Kamal Dodiya committed
36 37 38
    - sed -i "s#<DEPLOYMENT_ENV>#${SERVICE_SLUG}#g" ensembl_client_service_cluster.yaml
    - sed -i "s#<DEPLOYMENT_ENV>#${SERVICE_SLUG}#g" ensembl_client_ingress.yaml
    - sed -i "s#<SUB_DOMAIN>#${SERVICE_SLUG}#g" ensembl_client_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
39
    # ensembl-2020-server
Kamal Dodiya's avatar
Kamal Dodiya committed
40 41 42
    - sed -i "s#<DEPLOYMENT_ENV>#${BROWSER_SERVICE_SLUG}#g" ensembl_server_service.yaml
    - sed -i "s#<DEPLOYMENT_ENV>#${BROWSER_SERVICE_SLUG}#g" ensembl_server_ingress.yaml
    - sed -i "s#<SUB_DOMAIN>#${SERVICE_SLUG}#g" ensembl_server_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
43
    # ensembl-2020-genome-search
Kamal Dodiya's avatar
Kamal Dodiya committed
44 45
    - sed -i "s#<DEPLOYMENT_ENV>#${GENOME_SEARCH_SERVICE_SLUG}#g" ensembl_genome_search_service.yaml
    - sed -i "s#<DEPLOYMENT_ENV>#${GENOME_SEARCH_SERVICE_SLUG}#g" ensembl_genome_search_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
46
    - sed -i "s#<SUB_DOMAIN>#${SERVICE_SLUG}#g" ensembl_genome_search_ingress.yaml     
Kamal Dodiya's avatar
Kamal Dodiya committed
47 48 49 50
    # ensembl-thoas
    - sed -i "s#<DEPLOYMENT_ENV>#${THOAS_SERVICE_SLUG}#g" ensembl_thoas_service.yaml
    - sed -i "s#<DEPLOYMENT_ENV>#${THOAS_SERVICE_SLUG}#g" ensembl_thoas_ingress.yaml
    - sed -i "s#<SUB_DOMAIN>#${SERVICE_SLUG}#g" ensembl_thoas_ingress.yaml 
Kamal Dodiya's avatar
Kamal Dodiya committed
51 52 53 54
    # ensembl-refget
    - sed -i "s#<DEPLOYMENT_ENV>#${REFGET_SERVICE_SLUG}#g" ensembl_refget_service.yaml
    - sed -i "s#<DEPLOYMENT_ENV>#${REFGET_SERVICE_SLUG}#g" ensembl_refget_ingress.yaml
    - sed -i "s#<SUB_DOMAIN>#${SERVICE_SLUG}#g" ensembl_refget_ingress.yaml 
Kamal Dodiya's avatar
Kamal Dodiya committed
55 56 57 58
    # ensembl-help-docs
    - sed -i "s#<DEPLOYMENT_ENV>#${HELP_DOCS_SERVICE_SLUG}#g" ensembl_help_docs_service.yaml
    - sed -i "s#<DEPLOYMENT_ENV>#${HELP_DOCS_SERVICE_SLUG}#g" ensembl_help_docs_ingress.yaml
    - sed -i "s#<SUB_DOMAIN>#${SERVICE_SLUG}#g" ensembl_help_docs_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
59
  script:
Kamal Dodiya's avatar
Kamal Dodiya committed
60 61 62
    # ensembl-help-and-docs
    - kubectl apply -f ensembl_help_docs_service.yaml
    - kubectl apply -f ensembl_help_docs_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
63 64 65
    # ensembl-refget
    - kubectl apply -f ensembl_refget_service.yaml
    - kubectl apply -f ensembl_refget_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
66 67 68 69
    # ensembl-thoas
    - kubectl apply -f ensembl_thoas_service.yaml
    - kubectl apply -f ensembl_thoas_ingress.yaml
    # ensembl-2020-server
Kamal Dodiya's avatar
Kamal Dodiya committed
70 71
    - kubectl apply -f ensembl_server_service.yaml
    - kubectl apply -f ensembl_server_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
72
    # ensembl-2020-genome-search
Kamal Dodiya's avatar
Kamal Dodiya committed
73 74
    - kubectl apply -f ensembl_genome_search_service.yaml
    - kubectl apply -f ensembl_genome_search_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
75
    # ensembl-client
Kamal Dodiya's avatar
Kamal Dodiya committed
76 77 78 79 80 81 82 83 84 85
    - kubectl apply -f ensembl_client_service_cluster.yaml
    - kubectl apply -f ensembl_client_ingress.yaml

Setup-2020:
  extends: .deploy
  environment:
    name : wp-hx-dev-ing
  except:
    - dev
    - master