-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
83 lines (72 loc) · 2.35 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
before_script:
- composer -n -q install
- cp ~/Config.php src/snac/Config.php
- cp ~/users.csv install/setup_files/users.csv
- rm -rf ~/public_html/snac_server
- ln -s `pwd`/src/virtualhosts ~/public_html/snac_server
- ln -s `pwd`/src/snac/client/webui/templates ~/webui_templates
- ln -s `pwd`/src/snac/client/webui/languages ~/webui_languages
- ln -s `pwd`/src/snac/util ~/cpf_templates
- mkdir -p coverage/
stages:
- database_create
- database_refresh
- test
- documentation
- deploy
update_database:
script:
- cd install && php install.php automate
stage: database_create
only:
- never_run_this
refresh_database:
script:
- cd scripts && php refresh.php automate /home/gitlab-runner/testing.sql
stage: database_refresh
only:
- development
- master
- test_backup
run_test:
script:
- vendor/bin/phpunit --coverage-text --colors=never
stage: test
only:
- master
run_test_coverage:
script:
- vendor/bin/phpunit -v --coverage-html coverage/ --coverage-text
- rsync -avO coverage /lv2/snac/docs/
stage: test
only:
- development
generate_docs:
script:
- vendor/bin/phpdoc -d src/ -d test/ -t doc/ -i src/snac/Config.php --template="clean" --visibility="public" --title="SNAC Programming API" --validate --defaultpackagename="snac_server" --force
- rsync -av doc/ /lv2/snac/docs/
stage: documentation
only:
- never_run_this
deployment:
script:
- ssh snac-server "cd /lv2/snac && composer update && git fetch origin && git merge"
- ssh snac-web "cd /lv2/snac && composer update && git fetch origin && git merge"
- ssh snac-web "cd /lv2/snac && sed -i \"s/CACHE_COOKIE = .*;/CACHE_COOKIE = '`git rev-parse HEAD`';/g\" src/snac/Config.php"
stage: deploy
only:
- master
dev_deployment:
script:
- ssh snac-dev "cd /lv2/snac && composer update && git fetch origin && git merge"
- ssh snac-dev "cd /lv2/snac && sed -i \"s/CACHE_COOKIE = .*;/CACHE_COOKIE = '`git rev-parse HEAD`';/g\" src/snac/Config.php"
stage: deploy
only:
- development
alpha_deployment:
script:
- ssh snac-dev "cd /lv2/snac_alpha && composer update && git fetch origin && git merge"
- ssh snac-dev "cd /lv2/snac_alpha && sed -i \"s/CACHE_COOKIE = .*;/CACHE_COOKIE = '`git rev-parse HEAD`';/g\" src/snac/Config.php"
stage: deploy
only:
- alpha