-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
67 lines (58 loc) · 1.79 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
image: node:10.20.1
before_script:
- date
- node -v
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
stages:
- setup
- test
- build_files
- deploy
setup:
stage: setup
script:
- npm ci
linter:
stage: test
script:
- npm run lint
unit_test:
stage: test
script:
- npm run test:unit
artifacts:
reports:
junit: junit.xml
build_files:
stage: build_files
script:
- npm run build
artifacts:
paths:
- public
expire_in: 1 day
when: on_success
beta:
stage: deploy
script:
- ./node_modules/.bin/gatsby build --prefix-paths
- apt-get update -qq && apt-get install -y -qq lftp
- date
# Keep in mind that GitLab server has different time settings than the target one.
- lftp -c "set ftp:ssl-allow no; open -u $BETA_FTP_USERNAME,$BETA_FTP_PASSWORD $FTP_SERVER; mirror --reverse --delete-first --scan-all-first --depth-first --transfer-all --verbose public / --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/ --exclude .well-known/ --exclude cgi-bin/ --exclude api/ --exclude .htaccess --exclude error_log"
only:
- tags
staging:
stage: deploy
script:
- ./node_modules/.bin/gatsby build --prefix-paths
- apt-get update -qq && apt-get install -y -qq lftp
- date
# Keep in mind that GitLab server has different time settings than the target one.
- lftp -c "set ftp:ssl-allow no; open -u $STAGING_FTP_USERNAME,$STAGING_FTP_PASSWORD $FTP_SERVER; mirror --reverse --delete-first --scan-all-first --depth-first --transfer-all --verbose public / --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/ --exclude .well-known/ --exclude cgi-bin/ --exclude api/ --exclude .htaccess --exclude error_log"
only:
- master