Commit 31de6247 authored by David Mendez's avatar David Mendez
Browse files

Adapt CI to new runners

parent 58569f8d
......@@ -4,6 +4,7 @@ variables:
REGISTRY_USER: chembl/chembl
SERVER_APPLICATION: main-web-interface/elasticsearch-proxy-api
SERVER_IMAGE_TAG: ${CI_REGISTRY}/${REGISTRY_USER}/${SERVER_APPLICATION}:${CI_COMMIT_SHORT_SHA}
SERVER_IMAGE_TAG_LATEST: ${CI_REGISTRY}/${REGISTRY_USER}/${SERVER_APPLICATION}:latest
DOCKER_DRIVER: overlay
CONFIGS_FOLDER: run_config
# Config unit tests
......@@ -49,19 +50,23 @@ build_docker_image:
stage: build
services:
- docker:dind
tags:
- dind
variables:
DOCKER_HOST: tcp://docker:2375
before_script:
- apk add curl jq
- echo $DOCKERHUB_REGISTRY_PASSWORD | docker login -u $DOCKERHUB_REGISTRY_USER --password-stdin $DOCKERHUB_REGISTRY
- |
TOKEN=$(curl --user "${DOCKERHUB_REGISTRY_USER}:${DOCKERHUB_REGISTRY_PASSWORD}" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq --raw-output .token) && curl --head --header "Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest" 2>&1
script:
- set -x
- docker version # verify docker cli is there. Also prints server info
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- echo $DOCKERHUB_REGISTRY_PASSWORD | docker login -u $DOCKERHUB_REGISTRY_USER --password-stdin $DOCKERHUB_REGISTRY
- echo building $SERVER_IMAGE_TAG
- docker-compose build elasticsearch-proxy-api-prod
- echo Deploying $SERVER_IMAGE_TAG
- docker push $SERVER_IMAGE_TAG
- docker pull ${SERVER_IMAGE_TAG_LATEST} || true
- docker build --cache-from ${SERVER_IMAGE_TAG_LATEST} --tag ${SERVER_IMAGE_TAG} --tag ${SERVER_IMAGE_TAG_LATEST} --target production-server .
- docker push ${SERVER_IMAGE_TAG}
- docker push ${SERVER_IMAGE_TAG_LATEST}
## ----------------------------------------------------------------------------------------------------------------------
## QA
......@@ -73,8 +78,6 @@ pylint:
entrypoint: [""]
except:
- schedules
tags:
- docker
script:
- set -x
- find . -iname "*.py" | grep -v './app/free_text_parsing/.*' | xargs pylint
......@@ -93,8 +96,6 @@ prepare_config_tests:
- set -x
- mkdir -p ${CONFIGS_FOLDER}
- git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER}
tags:
- docker
artifacts:
paths:
- ${CONFIG_UNIT_TESTS_FILE_PATH}
......@@ -106,8 +107,6 @@ unit_tests:
entrypoint: [""]
except:
- schedules
tags:
- docker
script:
- set -x
- CONFIG_FILE_PATH=${CONFIG_UNIT_TESTS_FILE_PATH} python -m unittest
......@@ -127,8 +126,6 @@ prepare_config_staging:
- rm -rf ${CONFIGS_FOLDER} || true
- mkdir -p ${CONFIGS_FOLDER}
- git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER}
tags:
- docker
artifacts:
paths:
- ${CONFIG_STAGING_FILE_PATH}
......@@ -145,8 +142,6 @@ deploy_to_staging:
- staging
except:
- schedules
tags:
- docker
script:
- set -x
- echo "$KUBE_CA_PEM_HX" > "$(pwd)/kube.ca.pem"
......@@ -189,8 +184,6 @@ functional_tests_staging:
entrypoint: [""]
only:
- staging
tags:
- docker
script:
- set -x
- functional_tests/run_functional_tests.py ${ES_PROXY_API_URL_STAGING} https://wwwdev.ebi.ac.uk/chembl/interface_api/delayed_jobs
......@@ -211,8 +204,6 @@ prepare_config_prod_hx:
- rm -rf ${CONFIGS_FOLDER} || true
- mkdir -p ${CONFIGS_FOLDER}
- git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER}
tags:
- docker
artifacts:
paths:
- ${CONFIG_PROD_HX_FILE_PATH}
......@@ -229,8 +220,6 @@ deploy_to_prod_hx:
- master
except:
- schedules
tags:
- docker
script:
- set -x
- echo "$KUBE_CA_PEM_HX" > "$(pwd)/kube.ca.pem"
......@@ -270,8 +259,6 @@ functional_tests_prod_hx:
entrypoint: [""]
only:
- master
tags:
- docker
script:
- set -x
- sleep 30 # Give some time for the deployment to take effect.
......@@ -294,8 +281,6 @@ prepare_config_prod_hh:
- mkdir -p ${CONFIGS_FOLDER}
- git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER}
- ls ${CONFIGS_FOLDER}
tags:
- docker
artifacts:
paths:
- ${CONFIG_PROD_HH_FILE_PATH}
......@@ -312,8 +297,6 @@ deploy_to_prod_hh:
- master
except:
- schedules
tags:
- docker
script:
- set -x
- echo "$KUBE_CA_PEM_HH" > "$(pwd)/kube.ca.pem"
......@@ -353,8 +336,6 @@ functional_tests_prod_hh:
entrypoint: [""]
only:
- master
tags:
- docker
script:
- set -x
- sleep 30 # Give some time for the deployment to take effect.
......@@ -371,8 +352,6 @@ functional_tests_prod_public:
only:
- master
needs: ["functional_tests_prod_hh", "functional_tests_prod_hx"]
tags:
- docker
script:
- set -x
- sleep 30 # Give some time for the deployment to take effect.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment