-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
93 lines (87 loc) · 3.21 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
stages:
- test
- deploy
variables:
VCF_VALIDATOR_VERSION: 0.9.4
MONGO_HOST: mongo
POSTGRES_HOST: postgres
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
test:
stage: test
image: ubuntu:20.04
services:
- mongo:4.0.21
- postgres:9.6
before_script:
- apt-get update
- apt-get upgrade -y
- apt-get install -y tzdata
- apt-get install -y wget
- apt-get install -y curl
- apt-get install -y git
- apt-get install -y rsync
- apt-get install -y openjdk-11-jdk
- apt-get -y install maven samtools bcftools parallel libbz2-dev liblzma-dev
- bash -c "export JAVA_CMD="$(which java)" && cd /usr/bin && (curl -s https://get.nextflow.io | bash) && chmod 755 nextflow"
- /usr/bin/nextflow -version
- bash -c "cd /usr/bin && wget https://github.com/EBIvariation/vcf-validator/releases/download/v$VCF_VALIDATOR_VERSION/vcf_validator_linux && chmod 755 vcf_validator_linux"
- bash -c "cd /usr/bin && wget https://github.com/EBIvariation/vcf-validator/releases/download/v$VCF_VALIDATOR_VERSION/vcf_assembly_checker_linux && chmod 755 vcf_assembly_checker_linux"
- apt-get install -y python3
- apt-get install -y python3-pip
- python3 -m pip install --upgrade pip
- pip install pytest certifi
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- python3 setup.py install
- curl https://d3gcli72yxqn2z.cloudfront.net/connect_latest/v4/bin/ibm-aspera-connect_4.1.3.93_linux.tar.gz -o ibm-aspera-connect.tar.gz
- tar xzf ibm-aspera-connect.tar.gz
- ./ibm-aspera-connect_*_linux.sh
- chmod +x ~/.aspera/connect/bin/ascp; ln -s ~/.aspera/connect/bin/ascp /usr/bin
# 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
- export ASPERA_ID_DSA=~/.aspera/connect/etc/asperaweb_id_dsa.openssh
- export NXF_DEFAULT_DSL=1
script:
- PYTHONPATH=. pytest tests
environment:
name: test-env
only:
- external_pull_requests
- tags
- master
- main
# Not executed, parent job definition
.deploy-python-tool:
stage: deploy
image: ubuntu:20.04
environment:
name: $ENVIRONMENT_NAME
script:
# Start ssh-agent and set identity then copy the Jar file and create a symlink
# 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}@${CLUSTER_LOGIN_NODE_CODON} "${EVA_SOFTWARE_PATH_CODON}/covid19dp-submission/${ENVIRONMENT_NAME}_deployments/deploy.sh ${DEPLOY_POINT}"
dependencies:
- test
deploy-python-tool-development:
extends: .deploy-python-tool
variables:
ENVIRONMENT_NAME: development
DEPLOY_POINT: $CI_COMMIT_BRANCH
only:
- external_pull_requests
- master
- main
deploy-python-tool-production:
extends: .deploy-python-tool
variables:
ENVIRONMENT_NAME: production
DEPLOY_POINT: $CI_COMMIT_TAG
only:
- tags