Permalink
Fetching contributors…
Cannot retrieve contributors at this time
321 lines (281 sloc) 6.7 KB
before_script:
- make demo
- make data
- make germline
- make -C browser sha1
- cp -p doc/analysis-example.vidjil browser/
stages:
- test_tools
- test_quality
- test_unit
- deploy_review
- test_germlines
- test_functional
- test_functional_external
- test_shouldvdj
- coverage
- prepare_release
- release
- valgrind_unit
- valgrind_functional
- multiple_tests
- prepare_deploy
- deploy_prod
# Anchors
.coverage_dependency: &lcov_artifact
artifacts:
paths:
- algo/lcov_test_*.filtered
expire_in: 6hrs
# Tools
test_tools:
stage: test_tools
script: make -C tools/tests
# Germlines
test_germlines:
stage: test_germlines
script:
- make -C germline get-all-data
- make -C germline tests
only:
- /^feature-.*g.*\/.*$/
# Algorithm
test_algo_unit:
stage: test_unit
script: make -C algo unit_coverage
<<: *lcov_artifact
only:
- /^feature-.*a.*\/.*$/
test_algo_should:
stage: test_functional
script: make -C algo should_coverage
only:
- /^feature-.*a.*\/.*$/
<<: *lcov_artifact
test_algo_shouldvdj:
stage: test_shouldvdj
script: make -C algo shouldvdj_coverage
<<: *lcov_artifact
only:
- /^feature-.*a.*\/.*$/
algo_coverage:
stage: coverage
coverage: /^\s*lines\.*:\s+([0-9.]+\%)/
script:
- make -C algo lcov_reports
- mv algo/reports/ coverage
artifacts:
paths:
- coverage/
only:
- /^feature-.*a.*\/.*$/
algo_valgrind_unit:
stage: valgrind_unit
script: make -C algo valgrind_unit
only:
- /^feature-.*a.*\/.*$/
tags:
- valgrind
.snip_valgrind_functional: &valgrind_functional
stage: valgrind_functional
script: make -C algo valgrind_should
tags:
- valgrind
algo_valgrind_functional:
<<: *valgrind_functional
when: manual
only:
- /^feature-.*a.*\/.*$/
release_valgrind_functional:
<<: *valgrind_functional
only:
- /^feature-.*a.*\/release$/
prepare_release:
stage: prepare_release
script: make -C algo release RELEASE_TAG='rc'
when: manual
only:
- /^feature-.*a.*\/.*$/
release:
stage: release
script: make -C algo release RELEASE_TAG=`cat algo/release`
when: manual
only:
- /^feature-.*a.*\/release$/
artifacts:
paths:
- algo/releases/vidjil-algo-`cat algo/release`.tar.gz
- algo/releases/vidjil-algo-`cat algo/release`/vidjil-algo-`cat algo/release`_`uname -m`
allow_failure: false
tags:
- ubuntu-16.04-amd64
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$/
deploy_release_prod:
stage: deploy_prod
only:
- /^feature-.*a.*\/release$/
script:
- |
release_name=$(cat algo/release)
ssh $DEPLOY_SERVER "cd releases/vidjil;\
tar xvzf vidjil-algo-${release_name}.tar.gz;\
make -C vidjil-algo-${release_name};\
ln -sfT vidjil-algo-${release_name} next"
.testing-compilers: &test_various_compilers
stage: multiple_tests
tags:
- several-compilers
script:
- |
for CXX in $COMPILERS; do
echo "**** Using $CXX for compilation ****"
make -C algo clean
make -C algo CXX=$CXX unit
make -C algo CXX=$CXX should
make -C algo CXX=$CXX valgrind_unit
done
test_various_compilers_manual:
<<: *test_various_compilers
when: manual
only:
- /^feature-.*a.*\/.*$/
test_various_compilers_release:
<<: *test_various_compilers
only:
- /^feature-.*a.*\/release$/
# Client
test_browser_unit:
stage: test_unit
script: make unit_browser
artifacts:
paths:
- browser/
only:
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
- prod-client
- dev
tags:
- web
test_browser-functional:
stage: test_functional
script:
- make -C browser
- source /etc/profile.d/rvm.sh
- rvm use 2.1.1
- HEADLESS=1 make -C browser/test functional
artifacts:
paths:
- browser/
only:
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
- prod-client
tags:
- web
test_browser-functional-external:
stage: test_functional_external
retry: 2
script:
- make -C browser
- source /etc/profile.d/rvm.sh
- rvm use 2.1.1
- HEADLESS=1 make -C browser/test external
artifacts:
paths:
- browser/
only:
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
- prod-client
tags:
- web
code_quality:
stage: test_quality
script: make -C browser quality
only:
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
- prod-client
- dev
tags:
- web
# Server
test_server_unit:
stage: test_unit
script:
- virtualenv $CI_BUILD_REF_SLUG
- source $CI_BUILD_REF_SLUG/bin/activate
- pip install -r requirements.txt
- make -C server install_web2py_standalone
- make -C server launch_fuse_server
- make unit_server || (make -C server kill_fuse_server; deactivate; false)
- make -C server kill_fuse_server
- deactivate
only:
- /^feature-.*s.*\/.*$/
- /^hotfix-.*s.*\/.*$/
- prod-server
- dev
tags:
- web
# Deployment
deploy_review:
stage: deploy_review
script:
- make -C browser icons
- echo "$REVIEW_CONFIG_JS" > browser/js/conf.js
- rsync -av --delete browser $DEPLOY_SERVER:$DEPLOY_SERVER_PATH$CI_BUILD_REF_SLUG
environment:
name: review/$CI_BUILD_REF_NAME
url: http://$CI_BUILD_REF_SLUG.ci.vidjil.org/?data=analysis-example.vidjil
on_stop: stop_deploy_review
only:
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
tags:
- web
deploy_prod:
stage: deploy_prod
script:
- 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/"
environment:
name: production
url: http://$PROD_CLIENT_SERVER/?data=analysis-example.vidjil
only:
- prod-client
tags:
- web
stop_deploy_review:
stage: deploy_review
variables:
GIT_STRATEGY: none
script:
- ssh $DEPLOY_SERVER "rm -rf $DEPLOY_SERVER_PATH$CI_BUILD_REF_SLUG"
when: manual
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
only:
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
tags:
- web