.gitlab-ci.yml 3.51 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 8 9
variables:
  BROWSER_SERVICE_SLUG: dev
  GENOME_SEARCH_SERVICE_SLUG: dev
  TOYGRAPHQL_SERVICE_SLUG: dev
  THOAS_SERVICE_SLUG: dev

Kamal Dodiya's avatar
Kamal Dodiya committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
.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
25 26 27 28 29 30 31
    - TOYGRAPHQL_TAG=`yq r values.yaml be-services.toygraphql-service`
    - TOYGRAPHQL_TAG="${TOYGRAPHQL_TAG//[[:space:]]/}"
    - TOYGRAPHQL_SERVICE_SLUG="${TOYGRAPHQL_TAG//[^[:alnum:]]/-}"
    - 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:]]/-}"
    # ensembl-client
Kamal Dodiya's avatar
Kamal Dodiya committed
32 33 34
    - 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
35
    # ensembl-2020-server
Kamal Dodiya's avatar
Kamal Dodiya committed
36 37 38
    - 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
39
    # ensembl-2020-genome-search
Kamal Dodiya's avatar
Kamal Dodiya committed
40 41 42
    - 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
    - sed -i "s#<SUB_DOMAIN>#${SERVICE_SLUG}#g" ensembl_genome_search_ingress.yaml   
Kamal Dodiya's avatar
Kamal Dodiya committed
43 44 45 46 47 48 49 50
    # ensembl-toygraphql
    - sed -i "s#<DEPLOYMENT_ENV>#${TOYGRAPHQL_SERVICE_SLUG}#g" ensembl_graphql_server_service.yaml
    - sed -i "s#<DEPLOYMENT_ENV>#${TOYGRAPHQL_SERVICE_SLUG}#g" ensembl_graphql_server_ingress.yaml
    - sed -i "s#<SUB_DOMAIN>#${SERVICE_SLUG}#g" ensembl_graphql_server_ingress.yaml   
    # 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
  script:
Kamal Dodiya's avatar
Kamal Dodiya committed
52 53 54 55 56 57 58
    # ensembl-thoas
    - kubectl apply -f ensembl_thoas_service.yaml
    - kubectl apply -f ensembl_thoas_ingress.yaml
    # ensembl-toygraphql
    - kubectl apply -f ensembl_graphql_server_service.yaml
    - kubectl apply -f ensembl_graphql_server_ingress.yaml
    # ensembl-2020-server
Kamal Dodiya's avatar
Kamal Dodiya committed
59 60
    - kubectl apply -f ensembl_server_service.yaml
    - kubectl apply -f ensembl_server_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
61
    # ensembl-2020-genome-search
Kamal Dodiya's avatar
Kamal Dodiya committed
62 63
    - kubectl apply -f ensembl_genome_search_service.yaml
    - kubectl apply -f ensembl_genome_search_ingress.yaml
Kamal Dodiya's avatar
Kamal Dodiya committed
64
    # ensembl-client
Kamal Dodiya's avatar
Kamal Dodiya committed
65 66 67 68 69 70 71 72 73 74
    - 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