-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
69 lines (65 loc) · 1.95 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
stages:
- build
- deploymaster
- deploydev
- ontags
packen:
image: node:fermium
stage: build
script:
- PATH="./node_modules/.bin:$PATH"
- npm install yarn
- yarn
- yarn run build
- cd build
- if [ "${CI_COMMIT_TAG}" != "" ]; then TAG="-${CI_COMMIT_TAG}"; else TAG="-latest"; fi
- tar -czf ${CI_PROJECT_NAME}${TAG}.tar.gz *
- mkdir ../release
- mv ./${CI_PROJECT_NAME}${TAG}.tar.gz ../release/
- cd ..
artifacts:
paths:
- ./release
- ./build
only:
- master
- development
- tags
deploy:
image: alpine:latest
stage: deploymaster
script:
- apk add --no-cache sshpass
- apk add --no-cache openssh
- export SSHPASS=${PASS}
- ls
- sshpass -e ssh -o stricthostkeychecking=no -p 44 [email protected] "rm -rf ./dditools/struktog/*"
- sshpass -e scp -o stricthostkeychecking=no -P 44 -r ./build/* [email protected]:dditools/struktog
- sshpass -e scp -o stricthostkeychecking=no -P 44 ./release/${CI_PROJECT_NAME}-latest.tar.gz [email protected]:dditools/releases/struktog
variables:
GIT_STRATEGY: none
only:
- master
ontags:
image: alpine:latest
stage: ontags
script:
- apk add --no-cache sshpass
- apk add --no-cache openssh
- export SSHPASS=${PASS}
- sshpass -e scp -o stricthostkeychecking=no -P 44 ./release/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz [email protected]:dditools/releases/struktog
only:
- tags
deploydev:
image: alpine:latest
stage: deploydev
script:
- apk add --no-cache sshpass
- apk add --no-cache openssh
- export SSHPASS=${PASS}
- sshpass -e ssh -o stricthostkeychecking=no -p 44 [email protected] "rm -rf ./dditools/dev/struktog/*"
- sshpass -e scp -o stricthostkeychecking=no -P 44 -r ./build/* [email protected]:dditools/dev/struktog
variables:
GIT_STRATEGY: none
only:
- development