.gitlab-ci.yml 5.6 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
  - prepare_release
20
  - release
Mathieu Giraud's avatar
Mathieu Giraud committed
21 22
  - valgrind_unit
  - valgrind_functional
23
  - prepare_deploy
24
  - deploy_prod
25

26

27 28 29 30 31 32
# Tools

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

33 34 35 36 37 38 39

# Germlines

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


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

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

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

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

test_algo_shouldvdj:
  stage: test_shouldvdj
67
  script: make -C algo shouldvdj
68
  only:
69
    - /^feature-.*a.*\/.*$/
70

Mathieu Giraud's avatar
Mathieu Giraud committed
71 72
algo_valgrind_unit:
  stage: valgrind_unit
73
  script: make -C algo valgrind_unit
Mathieu Giraud's avatar
Mathieu Giraud committed
74
  only:
75
    - /^feature-.*a.*\/.*$/
76 77
  tags:
    - valgrind
Mathieu Giraud's avatar
Mathieu Giraud committed
78 79 80

algo_valgrind_functional:
  stage: valgrind_functional
81
  script: make -C algo valgrind_should
Mathieu Giraud's avatar
Mathieu Giraud committed
82 83
  when: manual
  only:
84
    - /^feature-.*a.*\/.*$/
85 86
  tags:
    - valgrind
Mathieu Giraud's avatar
Mathieu Giraud committed
87

88 89 90 91 92
prepare_release:
  stage: prepare_release
  script: make -C algo release RELEASE_TAG='rc'
  when: manual
  only:
93
    - /^feature-.*a.*\/.*$/
94

95 96 97 98 99
release:
  stage: release
  script: make -C algo release RELEASE_TAG=`cat algo/release`
  when: manual
  only:
100
    - /^feature-.*a.*\/release$/
101
  artifacts:
102
    paths:
103 104
    - algo/releases/vidjil-algo-`cat algo/release`.tar.gz
    - algo/releases/vidjil-algo-`cat algo/release`/vidjil-algo-`cat algo/release`_`uname -m`
105
  allow_failure: false
106 107
  tags:
    - ubuntu-16.04-amd64
108

109 110 111 112 113 114 115 116 117 118 119 120 121 122
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$/

123 124 125 126 127 128 129 130 131 132 133 134
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
135
# Client
136

137
test_browser_unit:
138
  stage: test_unit
Mathieu Giraud's avatar
Mathieu Giraud committed
139
  script: make unit_browser
140 141 142
  artifacts:
    paths:
    - browser/
143
  only:
144 145
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
Mathieu Giraud's avatar
Mathieu Giraud committed
146
    - prod-client
147
    - dev
148 149
  tags:
    - web
150

151 152
test_browser-functional:
  stage: test_functional
153 154 155 156
  script:
    - make -C browser
    - source /etc/profile.d/rvm.sh
    - rvm use 2.1.1
157 158 159 160 161
    - HEADLESS=1 make -C browser/test functional
  artifacts:
    paths:
    - browser/
  only:
162 163
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
164
    - prod-client
165 166
  tags:
    - web
167 168 169

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

186 187
code_quality:
  stage: test_quality
188
  script: make -C browser quality
189
  only:
190 191
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
192
    - prod-client
193
    - dev
194 195
  tags:
    - web
196

Ryan Herbert's avatar
Ryan Herbert committed
197 198 199 200 201
# Server

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

# Deployment

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

236
deploy_prod:
237
  stage: deploy_prod
238
  script:
239 240 241 242 243 244 245
    - 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/"
246 247
  environment:
    name: production
248
    url: http://$PROD_CLIENT_SERVER/?data=analysis-example.vidjil
249 250
  only:
    - prod-client
251 252
  tags:
    - web
253

254 255
stop_deploy_review:
  stage: deploy_review
256 257 258 259 260 261
  variables:
    GIT_STRATEGY: none
  script:
    - ssh $DEPLOY_SERVER "rm -rf $DEPLOY_SERVER_PATH$CI_BUILD_REF_SLUG"
  when: manual
  environment:
262
    name: review/$CI_BUILD_REF_NAME
263
    action: stop
264
  only:
265 266
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
267
  tags:
268
    - web