.gitlab-ci.yml 2.03 KB
Newer Older
Kamal Dodiya's avatar
Kamal Dodiya committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
stages:
  - deploy

.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:]]/-}"
    - 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
    - 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
    - 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   
  script:
    - kubectl apply -f ensembl_server_service.yaml
    - kubectl apply -f ensembl_server_ingress.yaml
    - kubectl apply -f ensembl_genome_search_service.yaml
    - kubectl apply -f ensembl_genome_search_ingress.yaml
    - 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