.gitlab-ci.yml 5.74 KB
Newer Older
1 2 3


before_script:
Mathieu Giraud's avatar
Mathieu Giraud committed
4
  - make demo
5 6
  - make data
  - make germline
7
  - make -C browser sha1
8
  - cp -p doc/analysis-example.vidjil browser/
9 10

stages:
11
  - test_tools
12
  - test_quality
13
  - test_unit
14
  - deploy_review
15
  - test_germlines
16
  - test_functional
17
  - test_functional_external
18
  - test_shouldvdj
19
  - coverage
20
  - prepare_release
21
  - release
Mathieu Giraud's avatar
Mathieu Giraud committed
22 23
  - valgrind_unit
  - valgrind_functional
24
  - prepare_deploy
25
  - deploy_prod
26

27

28 29 30 31 32 33
# Tools

test_tools:
  stage: test_tools
  script: make -C tools/tests

34 35 36 37 38 39 40

# Germlines

test_germlines:
  stage: test_germlines
  script:
    - make -C germline get-all-data
Mathieu Giraud's avatar
Mathieu Giraud committed
41
    - make -C germline/tests
42
  only:
43
    - /^feature-.*g.*\/.*$/
44 45


Mathieu Giraud's avatar
Mathieu Giraud committed
46
# Algorithm
47 48 49

test_algo_unit:
  stage: test_unit
50
  script: make -C algo unit_coverage
51
  only:
52
    - /^feature-.*a.*\/.*$/
53 54 55 56 57

test_tools_unit:
  stage: test_unit
  script: make -C tools/tests
  only:
58
    - /^feature-.*a.*\/.*$/
59 60 61

test_algo_should:
  stage: test_functional
62
  script: make -C algo should_coverage
63
  only:
64
    - /^feature-.*a.*\/.*$/
65 66 67

test_algo_shouldvdj:
  stage: test_shouldvdj
68 69 70 71 72 73 74
  script: make -C algo shouldvdj_coverage
  only:
    - /^feature-.*a.*\/.*$/

algo_coverage:
  stage: coverage
  script: make -C algo lcov_reports
75
  only:
76
    - /^feature-.*a.*\/.*$/
77

Mathieu Giraud's avatar
Mathieu Giraud committed
78 79
algo_valgrind_unit:
  stage: valgrind_unit
80
  script: make -C algo valgrind_unit
Mathieu Giraud's avatar
Mathieu Giraud committed
81
  only:
82
    - /^feature-.*a.*\/.*$/
83 84
  tags:
    - valgrind
Mathieu Giraud's avatar
Mathieu Giraud committed
85 86 87

algo_valgrind_functional:
  stage: valgrind_functional
88
  script: make -C algo valgrind_should
Mathieu Giraud's avatar
Mathieu Giraud committed
89 90
  when: manual
  only:
91
    - /^feature-.*a.*\/.*$/
92 93
  tags:
    - valgrind
Mathieu Giraud's avatar
Mathieu Giraud committed
94

95 96 97 98 99
prepare_release:
  stage: prepare_release
  script: make -C algo release RELEASE_TAG='rc'
  when: manual
  only:
100
    - /^feature-.*a.*\/.*$/
101

102 103 104 105 106
release:
  stage: release
  script: make -C algo release RELEASE_TAG=`cat algo/release`
  when: manual
  only:
107
    - /^feature-.*a.*\/release$/
108
  artifacts:
109
    paths:
110 111
    - algo/releases/vidjil-algo-`cat algo/release`.tar.gz
    - algo/releases/vidjil-algo-`cat algo/release`/vidjil-algo-`cat algo/release`_`uname -m`
112
  allow_failure: false
113 114
  tags:
    - ubuntu-16.04-amd64
115

116 117 118 119 120 121 122 123 124 125 126 127 128 129
copy_release:
  stage: prepare_deploy
  script:
    - |
      for repo in $ALGO_REPOSITORIES; do
        echo "Copying release to $repo"
        scp algo/releases/vidjil-algo*.tar.gz algo/releases/vidjil-algo*/vidjil-algo-*_* $repo
      done
      release_name=$(cat algo/release)
      ssh $VIDJIL_WWW "cd /var/www/html/releases; ln -sf vidjil-algo-${release_name}.tar.gz vidjil-latest.tgz; ln -sf vidjil-algo-${release_name}_x86_64 vidjil-latest_x86_64"
      ssh $VIDJIL_BONSAI "cd /bio1/www/html/vidjil; scp vidjil-algo-${release_name}* VIDJIL_BONSAI_PROD:/bio1/www/html/vidjil"
  only:
    - /^feature-.*a.*\/release$/

130 131 132 133 134 135 136 137 138 139 140 141
deploy_release_prod:
  stage: deploy_prod
  only:
    - /^feature-.*a.*\/release$/
  script:
    - |
      release_name=$(cat algo/release)
      ssh $VIDJIL_SERVER "cd releases/vidjil;\
          tar xvzf vidjil-algo-${release_name}.tar.gz;\
          make -C vidjil-algo-${release_name}
          ln -sf vidjil-algo-${release_name} next"

Mathieu Giraud's avatar
Mathieu Giraud committed
142
# Client
143

144
test_browser_unit:
145
  stage: test_unit
Mathieu Giraud's avatar
Mathieu Giraud committed
146
  script: make unit_browser
147 148 149
  artifacts:
    paths:
    - browser/
150
  only:
151 152
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
Mathieu Giraud's avatar
Mathieu Giraud committed
153
    - prod-client
154
    - dev
155 156
  tags:
    - web
157

158 159
test_browser-functional:
  stage: test_functional
160 161 162 163
  script:
    - make -C browser
    - source /etc/profile.d/rvm.sh
    - rvm use 2.1.1
164 165 166 167 168
    - HEADLESS=1 make -C browser/test functional
  artifacts:
    paths:
    - browser/
  only:
169 170
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
171
    - prod-client
172 173
  tags:
    - web
174 175 176

test_browser-functional-external:
  stage: test_functional_external
177
  retry: 2
178 179 180 181 182
  script:
    - make -C browser
    - source /etc/profile.d/rvm.sh
    - rvm use 2.1.1
    - HEADLESS=1 make -C browser/test external
183 184 185
  artifacts:
    paths:
    - browser/
186
  only:
187 188
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
Mathieu Giraud's avatar
Mathieu Giraud committed
189
    - prod-client
190 191
  tags:
    - web
192

193 194
code_quality:
  stage: test_quality
195
  script: make -C browser quality
196
  only:
197 198
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
199
    - prod-client
200
    - dev
201 202
  tags:
    - web
203

Ryan Herbert's avatar
Ryan Herbert committed
204 205 206 207 208
# Server

test_server_unit:
    stage: test_unit
    script:
209 210
      - virtualenv $CI_BUILD_REF_SLUG
      - source $CI_BUILD_REF_SLUG/bin/activate
211
      - pip install -r requirements.txt
Ryan Herbert's avatar
Ryan Herbert committed
212
      - make -C server install_web2py_standalone
213
      - make -C server launch_fuse_server
214
      - make unit_server || (make -C server kill_fuse_server; deactivate; false)
Ryan Herbert's avatar
Ryan Herbert committed
215
      - make -C server kill_fuse_server
216
      - deactivate
Ryan Herbert's avatar
Ryan Herbert committed
217
    only:
218 219
      - /^feature-.*s.*\/.*$/
      - /^hotfix-.*s.*\/.*$/
Ryan Herbert's avatar
Ryan Herbert committed
220 221 222 223 224 225 226
      - prod-server
      - dev
    tags:
      - web

# Deployment

227 228
deploy_review:
  stage: deploy_review
229
  script:
230
    - make -C browser icons
231
    - echo "$REVIEW_CONFIG_JS" > browser/js/conf.js
232
    - rsync -av --delete browser $DEPLOY_SERVER:$DEPLOY_SERVER_PATH$CI_BUILD_REF_SLUG
233
  environment:
234
    name: review/$CI_BUILD_REF_NAME
Mikaël Salson's avatar
Mikaël Salson committed
235
    url: http://$CI_BUILD_REF_SLUG.ci.vidjil.org/?data=analysis-example.vidjil
Mathieu Giraud's avatar
Mathieu Giraud committed
236
    on_stop: stop_deploy_review
237
  only:
238 239
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
240 241
  tags:
    - web
242

243
deploy_prod:
244
  stage: deploy_prod
245
  script:
246 247 248 249 250 251 252
    - ssh $PROD_CLIENT_SERVER "
         cd $PROD_CLIENT_PATH;
         git fetch
         && git reset --hard origin/prod-client
         && make -C browser
         && make -C browser sha1
         && cp doc/analysis-example.vidjil browser/"
253 254
  environment:
    name: production
255
    url: http://$PROD_CLIENT_SERVER/?data=analysis-example.vidjil
256 257
  only:
    - prod-client
258 259
  tags:
    - web
260

261 262
stop_deploy_review:
  stage: deploy_review
263 264 265 266 267 268
  variables:
    GIT_STRATEGY: none
  script:
    - ssh $DEPLOY_SERVER "rm -rf $DEPLOY_SERVER_PATH$CI_BUILD_REF_SLUG"
  when: manual
  environment:
269
    name: review/$CI_BUILD_REF_NAME
270
    action: stop
271
  only:
272 273
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
274
  tags:
275
    - web