-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
64 lines (56 loc) · 1.28 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
stages:
- build
- deploy
- linking
include:
- project: 'sysadm-docker/ubuntu-sshclient'
ref: 'master'
file: 'gitlab-ci-template.yml'
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$CI_BUILD_SSH_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
build app:
stage: build
image: node:10.17.0
script:
- yarn install
- yarn run build
- chmod +x ./post-build.sh
- ./post-build.sh
tags:
- devops
only:
- /^v-.*$/
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- node_modules/
- .yarn
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
paths:
- build
when: on_success
expire_in: 1 day
deploy prod:
stage: deploy
dependencies:
- build app
extends: .deploy prod
when: on_success
environment:
name: prod/$CI_COMMIT_REF_NAME
url: https://livedemo.xsolla.com/store-demo-$CI_COMMIT_REF_NAME/
script:
- /usr/local/bin/helper deploy build
stop prod:
extends: .stop prod
current prod:
extends: .current prod
environment:
name: prod/current
url: https://livedemo.xsolla.com/store-demo/
when: manual