This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
.gitlab-ci.yml
158 lines (143 loc) · 3.23 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
image: node:10.15.1
variables:
CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
before_script:
- "apt-get update"
- "apt-get install -y build-essential"
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules
- ${CYPRESS_CACHE_FOLDER}
install and build:
stage: install
script:
- yarn install
artifacts:
expire_in: 2 hours
when: always
paths:
- node_modules
stages:
- install
- test
- build
- deploy
- integration tests
lint:
stage: test
script:
- yarn run lint
flow:
stage: test
script:
- yarn run flow
unit:
stage: test
script:
- yarn run test
build development:
stage: build
script:
- yarn run build:dev
artifacts:
expire_in: 1 week
paths:
- build/dev
build beta:
stage: build
script:
- yarn run build:beta
only:
- beta
artifacts:
expire_in: 1 week
paths:
- build/beta
- scripts/s3sync.sh
build stable:
stage: build
script:
- yarn run build:stable
only:
- stable
artifacts:
expire_in: 1 week
paths:
- build/stable
- scripts/s3sync.sh
deploy review:
stage: deploy
variables:
GIT_STRATEGY: none
dependencies:
- build development
environment:
name: $CI_BUILD_REF_NAME
url: $BASE_REVIEW_URL/$CI_BUILD_REF_NAME
on_stop: delete review
before_script: []
script:
- echo "Deploy a review app"
- '[ -z "${DEPLOY_BASE_DIR}" ] && echo "Deploy base dir cannot be empty" && exit 255'
- env
- mkdir -p "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}"
- echo "Copy dev build to web server ${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}..."
- rsync --delete -va build/dev/ "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}/"
- curl "https://api.telegram.org/bot699197118:AAGXNTaC5Q-ljmy_dMvaIvAKy1XjlkA3Iss/sendMessage?chat_id=-1001354778014&text=https://trezor-wallet-dev.trezor.io/${CI_BUILD_REF_NAME}"
- 'echo "Remove working dir, workaround for cache" && rm -r ./*'
only:
- branches
tags:
- deploy
deploy stage beta:
stage: deploy
variables:
GIT_STRATEGY: none
AWS_ACCESS_KEY_ID: $STAGE_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $STAGE_AWS_SECRET_ACCESS_KEY
when: manual
dependencies:
- build beta
before_script: []
script:
- scripts/s3sync.sh stage beta
only:
- beta
tags:
- deploy
deploy stage stable:
stage: deploy
variables:
GIT_STRATEGY: none
AWS_ACCESS_KEY_ID: $STAGE_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $STAGE_AWS_SECRET_ACCESS_KEY
when: manual
dependencies:
- build stable
before_script: []
script:
- scripts/s3sync.sh stage stable
only:
- stable
tags:
- deploy
delete review:
before_script: []
stage: deploy
variables:
GIT_STRATEGY: none
when: manual
environment:
name: $CI_BUILD_REF_NAME
action: stop
before_script: []
script:
- '[ -z "${DEPLOY_BASE_DIR}" ] && echo "Deploy dir can not be empty" && exit 1'
- '[ -z "${CI_BUILD_REF_NAME}" ] && echo "Build name can not be empty" && exit 1'
- '[ ! -d "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}" ] && echo "Folder can not be found, skipping..." && exit 0'
- 'rm -r "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}"'
only:
- branches
tags:
- deploy