-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
64 lines (58 loc) · 1.81 KB
/
.gitlab-ci.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
stages:
- test
- deploy
test:
stage: test
image: python:3.8.7-slim-buster
before_script:
- python -m pip install --upgrade pip
- pip install pytest certifi
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- python setup.py install
# reduce the default SSL security level to get around a misconfiguration in the Ensembl server
# https://github.com/Ensembl/ensembl-rest/issues/427
# See https://askubuntu.com/a/1233456
- sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/' /usr/lib/ssl/openssl.cnf
script:
- PYTHONPATH=. pytest tests
environment:
name: test-env
only:
- external_pull_requests
- tags
- master
# Not executed, parent job definition
.deploy-python-tool:
stage: deploy
image: python:3.8.7-slim-buster
environment:
name: $ENVIRONMENT_NAME
script:
# Start ssh-agent and set identity then run deploy script
# See https://docs.gitlab.com/ee/ci/ssh_keys/
- apt-get update
- apt-get -y install openssh-client
- eval "$(ssh-agent)"
- echo "$EVA_ETL_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${CLUSTER_USER}@${LOGIN_NODE} "${SOFTWARE_PATH}/eva-opentargets/deploy.sh ${DEPLOY_POINT} ${ENVIRONMENT_NAME}"
dependencies:
- test
deploy-python-tool-development:
extends: .deploy-python-tool
variables:
ENVIRONMENT_NAME: development
LOGIN_NODE: $CLUSTER_LOGIN_NODE_CODON
SOFTWARE_PATH: $EVA_SOFTWARE_PATH_CODON
DEPLOY_POINT: $CI_COMMIT_BRANCH
only:
- external_pull_requests
- master
deploy-python-tool-production:
extends: .deploy-python-tool
variables:
ENVIRONMENT_NAME: production
LOGIN_NODE: $CLUSTER_LOGIN_NODE_CODON
SOFTWARE_PATH: $EVA_SOFTWARE_PATH_CODON
DEPLOY_POINT: $CI_COMMIT_TAG
only:
- tags