-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
160 lines (148 loc) · 3.98 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
image: mpievolbioscicomp/repinpop_base
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
# runtime for each build is more reliable since the runtime is completely
# isolated from any previous builds.
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
stages:
- build
- test
- deploy
- release
build:
stage: build
script:
- export
- ./build.sh
artifacts:
paths:
- REPIN_ecology/REPIN_ecology/build/libs/REPIN_ecology.jar
- build
test:unittest:
stage: test
allow_failure: true
script:
- source /root/.bashrc
- conda activate repinpop
- conda install pytest
- source setenv.sh
- cd test/unittest
- pytest test_routes.py
test:neisseria:small:
stage: test
allow_failure: true
script:
- cd build
- make
- cd ..
- source /root/.bashrc
- conda activate repinpop
- source setenv.sh
- cd test/scripts
- ./test.sh neisseria_small clean setup run_java test_java run_andi test_andi run_clustdist test_clustdist
- mv /tmp/rarefan_test/neisseria_small/out ../data/neisseria_small/out
artifacts:
paths:
- test/data/neisseria_small/out
test:dokdonia:
stage: test
allow_failure: true
script:
- cd build
- make
- cd ..
- source /root/.bashrc
- conda activate repinpop
- source setenv.sh
- cd test/scripts
- ./dl_zenodo.sh dokdonia
- ./test.sh dokdonia clean setup run_java test_java run_andi test_andi run_clustdist test_clustdist
- mv /tmp/rarefan_test/dokdonia/out ../data/dokdonia/out
artifacts:
paths:
- test/data/dokdonia/out
test:neisseria:
stage: test
allow_failure: true
script:
- cd build
- make
- cd ..
- source /root/.bashrc
- conda activate repinpop
- source setenv.sh
- cd test/scripts
- ./dl_zenodo.sh neisseria
- ./test.sh neisseria clean setup ref_plots test_ref_plots
- mv /tmp/rarefan_test/neisseria/ref ../data/datasets/neisseria/ref
artifacts:
paths:
- test/data/datasets/neisseria/ref
test:chlororaphis:
stage: test
allow_failure: true
script:
- cd build
- make
- cd ..
- source /root/.bashrc
- conda activate repinpop
- source setenv.sh
- cd test/scripts
- ./dl_zenodo.sh chlororaphis
- ./test.sh chlororaphis clean setup ref_plots test_ref_plots
- mv /tmp/rarefan_test/chlororaphis/ref ../data/datasets/chlororaphis/ref
artifacts:
paths:
- test/data/datasets/chlororaphis/ref
deploy:
stage: deploy
dependencies:
- build
script:
- mkdir pkg-dist
- cp REPIN_ecology/REPIN_ecology/build/libs/REPIN_ecology.jar pkg-dist
- cp app/utilities/checkers.py pkg-dist
- cp app/utilities/rarefan_cli.py pkg-dist/rarefan
- chmod 755 pkg-dist/rarefan
- cd pkg-dist
- zip ../rarefan.zip *.jar *.py rarefan
- tar czvf ../rarefan.tar.gz *.jar *.py rarefan
artifacts:
paths:
- rarefan.zip
- rarefan.tar.gz
release_tag:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
needs:
- job: deploy
artifacts: true
script:
- apk add curl
- CI/push_to_OC.sh rarefan.zip rarefan-${CI_COMMIT_TAG}.zip
- CI/push_to_OC.sh rarefan.tar.gz rarefan-${CI_COMMIT_TAG}.tar.gz
release:
name: 'Tagged Release $CI_COMMIT_TAG'
description: 'Created by gitlab CI'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_REF_NAME'
release_commit:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: deploy
artifacts: true
script:
- apk add curl
- echo "Pushing to OC."
- CI/push_to_OC.sh rarefan.zip rarefan-${CI_COMMIT_SHORT_SHA}.zip
- CI/push_to_OC.sh rarefan.tar.gz rarefan-${CI_COMMIT_SHORT_SHA}.tar.gz
release:
name: 'Nightly Release $CI_COMMIT_SHORT_SHA'
description: 'Created by gitlab CI'
tag_name: '$CI_COMMIT_SHORT_SHA'
ref: '$CI_COMMIT_REF_NAME'