.gitlab-ci.yml 4.56 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 105
  tags:
    - ubuntu-16.04-amd64
106

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

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

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

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

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

169 170 171 172 173
# Server

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

# Deployment

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

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

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