forked from qualintitative/egoweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
117 lines (110 loc) · 3.24 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
update_dev:
stage: build
allow_failure: false
only:
refs:
- dev
before_script:
##
## Install ssh-agent if not already installed, it is required by Docker.
## (change apt-get to yum if you use an RPM-based image)
##
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
##
## Run ssh-agent (inside the build environment)
##
- eval $(ssh-agent -s)
##
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
# - mkdir -p ~/.ssh
# - chmod 700 ~/.ssh
#- ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
# - ssh-add -L
# - ssh -o StrictHostKeyChecking=no boxy.rand.org
##
## Create the SSH directory and give it the right permissions
##
#- mkdir /tmp/$CI_JOB_ID
#- cp -r * /tmp/$CI_JOB_ID
script:
- sudo -s
cp -r app/* /var/www/html/egoweb;
mkdir -p /var/www/html/egoweb/assets;
mkdir -p /var/www/html/egoweb/protected/runtime;
environment:
name: dev
url: http://egowebdev.rand.org/
update_alp_dev:
stage: build
allow_failure: false
only:
refs:
- alpdev
before_script:
- ssh boxy.rand.org "mkdir $CI_JOB_ID"
- scp -r * boxy.rand.org:$CI_JOB_ID
script:
- ssh boxy.rand.org "cp -r $CI_JOB_ID/app/* /var/www/html/alpegoweb;
mkdir -p /var/www/html/alpegoweb/assets;
mkdir -p /var/www/html/alpegoweb/protected/runtime;"
environment:
name: alp_dev
url: $ALP_DEV_URL
test_alp_dev:
stage: test
allow_failure: false
only:
refs:
- alpdev
script:
- cp -r ./test/wdio.conf.TEMPLATE.js ./test/wdio.conf.js
- sed -i "s/CONFIG_ADMINUSER/$TEST_ALP_DEV_ADMIN_USER/g" ./test/wdio.conf.js
- sed -i "s/CONFIG_ADMINPASSWORD/$TEST_ALP_DEV_ADMIN_PASSWD/g" ./test/wdio.conf.js
- sed -i "s/CONFIG_INTERVIEWERUSER/$TEST_ALP_DEV_USER/g" ./test/wdio.conf.js
- sed -i "s/CONFIG_INTERVIEWERPASSWORD/$TEST_ALP_DEV_PASSWD/g" ./test/wdio.conf.js
- sed -i "s~CONFIG_PHANTOMJS_PATH~/home/gitlab-runner/.local/bin/phantomjs~g" ./test/wdio.conf.js
- sed -i "s~CONFIG_BASEURL~$ALP_DEV_URL~g" ./test/wdio.conf.js
- cd ./test
- npm install
- ./node_modules/.bin/wdio wdio.conf.js
artifacts:
reports:
junit: ./test/junitresults/WDIO*.xml
environment:
name: alp_dev
url: $ALP_DEV_URL
test_alp_dev_api:
stage: test
allow_failure: false
only:
refs:
- alpdev
script:
- php ./test/APITest/testAPI.php $ALP_DEV_URL $ALP_DEV_PASSWD $TEST_ALP_DEV_SURVEY_ID
environment:
name: alp_dev
url: $ALP_DEV_URL
update_alp_prod:
stage: deploy
allow_failure: false
only:
refs:
- alp
before_script:
- ssh smgolding.randcorp.org "mkdir $CI_JOB_ID"
- scp -r * smgolding.randcorp.org:$CI_JOB_ID
script:
- ssh smgolding.randcorp.org "rm -rf backup;
mkdir -p backup;
yes | cp -rf /var/www/alpegoweb backup;
yes | cp -rf $CI_JOB_ID/app/* /var/www/alpegoweb;
mkdir -p /var/www/alpegoweb/assets;
mkdir -p /var/www/alpegoweb/protected/runtime;"
environment:
name: alp_prod
url: http://alpegoweb.rand.org/
when: manual