.gitlab-ci.yml 4.59 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
  - deploy_prod
24

25

26 27 28 29 30 31
# Tools

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

32 33 34 35 36 37 38

# Germlines

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


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

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

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

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

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

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

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

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

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

Mathieu Giraud's avatar
Mathieu Giraud committed
108
# Client
109

110
test_browser_unit:
111
  stage: test_unit
Mathieu Giraud's avatar
Mathieu Giraud committed
112
  script: make unit_browser
113 114 115
  artifacts:
    paths:
    - browser/
116
  only:
117 118
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
Mathieu Giraud's avatar
Mathieu Giraud committed
119
    - prod-client
120
    - dev
121 122
  tags:
    - web
123

124 125
test_browser-functional:
  stage: test_functional
126 127 128 129
  script:
    - make -C browser
    - source /etc/profile.d/rvm.sh
    - rvm use 2.1.1
130 131 132 133 134
    - HEADLESS=1 make -C browser/test functional
  artifacts:
    paths:
    - browser/
  only:
135 136
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
137
    - prod-client
138 139
  tags:
    - web
140 141 142

test_browser-functional-external:
  stage: test_functional_external
143
  retry: 2
144 145 146 147 148
  script:
    - make -C browser
    - source /etc/profile.d/rvm.sh
    - rvm use 2.1.1
    - HEADLESS=1 make -C browser/test external
149 150 151
  artifacts:
    paths:
    - browser/
152
  only:
153 154
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
Mathieu Giraud's avatar
Mathieu Giraud committed
155
    - prod-client
156 157
  tags:
    - web
158

159 160
code_quality:
  stage: test_quality
161
  script: make -C browser quality
162
  only:
163 164
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
165
    - prod-client
166
    - dev
167 168
  tags:
    - web
169

Ryan Herbert's avatar
Ryan Herbert committed
170 171 172 173 174
# Server

test_server_unit:
    stage: test_unit
    script:
175 176
      - virtualenv $CI_BUILD_REF_SLUG
      - source $CI_BUILD_REF_SLUG/bin/activate
177
      - pip install -r requirements.txt
Ryan Herbert's avatar
Ryan Herbert committed
178
      - make -C server install_web2py_standalone
179
      - make -C server launch_fuse_server
180
      - make unit_server || (make -C server kill_fuse_server; deactivate; false)
Ryan Herbert's avatar
Ryan Herbert committed
181
      - make -C server kill_fuse_server
182
      - deactivate
Ryan Herbert's avatar
Ryan Herbert committed
183
    only:
184 185
      - /^feature-.*s.*\/.*$/
      - /^hotfix-.*s.*\/.*$/
Ryan Herbert's avatar
Ryan Herbert committed
186 187 188 189 190 191 192
      - prod-server
      - dev
    tags:
      - web

# Deployment

193 194
deploy_review:
  stage: deploy_review
195
  script:
196
    - make -C browser icons
197
    - rsync -av --delete browser $DEPLOY_SERVER:$DEPLOY_SERVER_PATH$CI_BUILD_REF_SLUG
198
  environment:
199
    name: review/$CI_BUILD_REF_NAME
Mikaël Salson's avatar
Mikaël Salson committed
200
    url: http://$CI_BUILD_REF_SLUG.ci.vidjil.org/?data=analysis-example.vidjil
Mathieu Giraud's avatar
Mathieu Giraud committed
201
    on_stop: stop_deploy_review
202
  only:
203 204
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
205 206
  tags:
    - web
207

208
deploy_prod:
209
  stage: deploy_prod
210
  script:
211 212 213 214 215 216 217
    - 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/"
218 219
  environment:
    name: production
220
    url: http://$PROD_CLIENT_SERVER/?data=analysis-example.vidjil
221 222
  only:
    - prod-client
223 224
  tags:
    - web
225

226 227
stop_deploy_review:
  stage: deploy_review
228 229 230 231 232 233
  variables:
    GIT_STRATEGY: none
  script:
    - ssh $DEPLOY_SERVER "rm -rf $DEPLOY_SERVER_PATH$CI_BUILD_REF_SLUG"
  when: manual
  environment:
234
    name: review/$CI_BUILD_REF_NAME
235
    action: stop
236
  only:
237 238
    - /^feature-.*c.*\/.*$/
    - /^hotfix-.*c.*\/.*$/
239
  tags:
240
    - web