-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
68 lines (63 loc) · 1.4 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
stages:
- build
- deploy
build_develop:
stage: build
image: alpine:latest
only:
- merge_requests
- develop
tags:
- docker-exec
artifacts:
paths:
- develop_build/
before_script:
- apk add yarn
script:
- yarn install
- yarn build:dev
- mv -v build ./develop_build
build_5_1:
stage: build
image: alpine:latest
only:
- develop
tags:
- docker-exec
artifacts:
paths:
- 5.1_build/
before_script:
- apk add yarn
script:
- yarn install
- yarn build
- mv -v build ./5.1_build
upload_build:
stage: deploy
image: alpine:latest
only:
- develop
tags:
- docker-exec
dependencies:
- build_develop
- build_5_1
script:
- apk add zip openssh-client
- mkdir -p ~/.ssh
- echo "${DEPLOY_KNOWN_HOSTS}" > ~/.ssh/known_hosts
- echo "${DEPLOY_PUBKEY}" > ~/.ssh/id_rsa.pub
- echo "${DEPLOY_PRIVKEY}" > ~/.ssh/id_rsa
- chmod 700 ~/.ssh
- chmod 600 ~/.ssh/id_rsa
- chmod 644 ~/.ssh/id_rsa.pub ~/.ssh/known_hosts
- mkdir -p ./develop/webapp
- mv -f develop_build/* ./develop/webapp/
- zip -r qorus-webapp-develop.zip develop
- scp qorus-webapp-develop.zip ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/
- mkdir -p ./5.1/webapp
- mv -f 5.1_build/* ./5.1/webapp/
- zip -r qorus-webapp-5.1.zip 5.1
- scp qorus-webapp-5.1.zip ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/