.gitlab-ci.yml 4.44 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 39 40 41 42 43

# Germlines

test_germlines:
  stage: test_germlines
  script:
    - make -C germline get-all-data
    - make -C algo/tests should_germline
  only:
    - /^feature-g\/.*$/


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 50
  only:
    - /^feature-a\/.*$/
51 52 53 54 55 56

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

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

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

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 74
  only:
    - /^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 83
  when: manual
  only:
    - /^feature-a\/.*$/
84 85
  tags:
    - valgrind
Mathieu Giraud's avatar
Mathieu Giraud committed
86

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

94 95 96 97 98 99 100
release:
  stage: release
  script: make -C algo release RELEASE_TAG=`cat algo/release`
  when: manual
  only:
    - /^feature-a\/release$/
  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
    - /^feature-[cw]\/.*$/
117
    - /^hotfix-[cw]\/.*$/
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 134 135 136
    - HEADLESS=1 make -C browser/test functional
  artifacts:
    paths:
    - browser/
  only:
    - /^feature-[cw]\/.*$/
    - /^hotfix-[cw]\/.*$/
    - 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
    - /^feature-[cw]\/.*$/
153
    - /^hotfix-[cw]\/.*$/
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 162 163 164
  only:
    - /^feature-[cw]\/.*$/
    - /^hotfix-[cw]\/.*$/
    - 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 180 181 182 183 184
      - >
        make unit_server
        exit_code=$?
        make -C server kill_fuse_server
        deactivate
        exit $exit_code
185 186 187 188 189 190 191 192 193 194
    only:
      - /^feature-[sw]\/.*$/
      - /^hotfix-[sw]\/.*$/
      - prod-server
      - dev
    tags:
      - web

# Deployment

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

210
deploy_prod:
211
  stage: deploy_prod
212
  script:
213
    - rsync -av --delete browser $PROD_CLIENT_SERVER:$PROD_CLIENT_PATH
214
    - ssh $PROD_CLIENT_SERVER "cp -pr $PROD_CLIENT_PATH_TEMPLATE/browser $PROD_CLIENT_PATH"
215 216
  environment:
    name: production
217
    url: http://app.vidjil.org/?data=analysis-example.vidjil
218 219
  only:
    - prod-client
220 221
  tags:
    - web
222

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