-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
182 lines (160 loc) · 4.3 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
stages:
- test
- build
- push
- publish
test:
image: ${IMAGE}:16.04
stage: test
tags:
- linux
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -qq && apt-get install -y -qq
python-virtualenv python3-dev
script:
- PYTHON=python3 make test
###
# Windows
#
.build-win: &build-win
stage: build
tags:
- epi2melabs-win
build-win-colab:
<<: *build-win
variables:
NOCOLAB: 0
script:
- .\winbuild.ps1
- Move-Item dist/epi2melabs-installer.exe ont-epi2melabs-installer.exe
artifacts:
paths:
- "ont-epi2melabs-installer.exe"
build-win-nocolab:
<<: *build-win
variables:
NOCOLAB: 1
script:
- .\winbuild.ps1
- Move-Item dist/epi2melabs-installer.exe ont-epi2melabs-jupyter-installer.exe
artifacts:
paths:
- "ont-epi2melabs-jupyter-installer.exe"
###
# Ubuntu
#
.build-ubuntu: &build-ubuntu
image: ${IMAGEUSED}
stage: build
tags:
- linux
script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -qq && apt-get install -y -qq
build-essential wget fakeroot rsync ssh python-virtualenv python3-dev xvfb libx11-xcb1 libxext6 libxrender1 libsm6 libice6 libglib2.0-0
- PYTHON=python3 make deb
- dpkg -I ont-epi2melabs-launcher*.deb
artifacts:
paths:
- "ont-epi2melabs-launcher*.deb"
except:
- tags
.setup-tag: &tag
before_script:
- IFS='.' read -ra PARTS <<< "${CI_COMMIT_TAG}"
- export MAJOR=${PARTS[0]:1}
- export MINOR=${PARTS[1]}
- export SUB=${PARTS[2]}
- export DEBVER="$MAJOR.$MINOR.$SUB"
# check the version in the python package matches the tag
- PYVER=$(grep "__version__ = " labslauncher/__init__.py | awk '{gsub("\"","",$3); print $3}')
- echo "DEBVER='$DEBVER' PYVER='$PYVER'"
- if [[ "$PYVER" != "$DEBVER" ]]; then echo "Mismatching TAG and PACKAGE versions"; exit 1; else echo "TAG and PACKAGE versions agree."; fi
- echo -e "\e[1m\e[34mTagging with '\e[35m$MAJOR.$MINOR.$SUB\e[34m'\e[0m"
only:
- /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/
except:
- branches
.xenial-colab: &xenial-colab
<<: *build-ubuntu
variables:
IMAGEUSED: ${IMAGE}:16.04
NOCOLAB: 0
.xenial-nocolab: &xenial-nocolab
<<: *build-ubuntu
variables:
IMAGEUSED: ${IMAGE}:16.04
NOCOLAB: 1
.bionic-colab: &bionic-colab
<<: *build-ubuntu
variables:
IMAGEUSED: ${IMAGE}:18.04
NOCOLAB: 0
.bionic-nocolab: &bionic-nocolab
<<: *build-ubuntu
variables:
IMAGEUSED: ${IMAGE}:18.04
NOCOLAB: 1
# branches
xenial-deb-colab:
<<: *xenial-colab
xenial-deb-nocolab:
<<: *xenial-nocolab
bionic-deb-colab:
<<: *bionic-colab
bionic-deb-nocolab:
<<: *bionic-nocolab
# tags
xenial-tag-colab:
<<: *xenial-colab
<<: *tag
xenial-tag-nocolab:
<<: *xenial-nocolab
<<: *tag
bionic-tag-colab:
<<: *bionic-colab
<<: *tag
bionic-tag-nocolab:
<<: *bionic-nocolab
<<: *tag
###
# Push
#
bundle:
stage: publish
script:
- echo "Just gathering artifacts in one place"
artifacts:
paths:
- "ont-epi2melabs*installer.exe"
- "ont-epi2melabs-launcher*.deb"
.setup-deb-push: &setup-deb-push
image: ${IMAGE}:16.04
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "${SSH_PRIVATE_KEY}")
push-debs:
<<: *setup-deb-push
stage: push
script:
- for CODENAME in xenial bionic; do scp -o StrictHostKeyChecking=no *${CODENAME}.deb ${DEBREPO}:/var/www/apt/${CODENAME}-stable; done
only:
- /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/
except:
- branches
push-external:
<<: *setup-deb-push
stage: publish
script:
- for CODENAME in xenial bionic; do scp -o StrictHostKeyChecking=no *${CODENAME}.deb ${EXTERNALDEBREPO}:/mirror/apt/incoming/${CODENAME}-stable; done
dependencies:
- xenial-tag-colab
- xenial-tag-nocolab
- bionic-tag-colab
- bionic-tag-nocolab
only:
- /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/
except:
- branches
when: manual