forked from ClearURLs/Rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
65 lines (60 loc) · 1.55 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
image: debian:latest
before_script:
- export DEBIAN_FRONTEND= noninteractive
- apt-get update -y
- apt-get install -y nodejs jsonlint
stages:
- test
- build
- deploy
test rules:
stage: test
script:
- jsonlint-php data.min.json
only:
refs:
- merge_requests
- master
changes:
- data.min.json
hash rules:
stage: build
script:
- sha256sum data.min.json | awk '{print $1}' > rules.min.hash
- node build_tools/minifyDataJSON.js "data.min.json" "data.minify.json"
- sha256sum data.minify.json | awk '{print $1}' > rules.minify.hash
artifacts:
paths:
- rules.min.hash
- data.minify.json
- rules.minify.hash
only:
refs:
- merge_requests
- master
changes:
- data.min.json
pages:
stage: deploy
script:
- mkdir public
- cp data.min.json public/data.min.json
- sha256sum public/data.min.json | awk '{print $1}' > public/rules.min.hash
- node build_tools/minifyDataJSON.js "public/data.min.json" "public/data.minify.json"
- sha256sum public/data.minify.json | awk '{print $1}' > public/rules.minify.hash
# Support old refs
- mkdir public/data
- cp public/data.min.json public/data/data.min.json
- cp public/rules.min.hash public/data/rules.min.hash
- cp public/data.minify.json public/data/data.minify.json
- cp public/rules.minify.hash public/data/rules.minify.hash
artifacts:
paths:
- public
only:
refs:
- merge_requests
- master
changes:
- data.min.json
- build_tools/minifyDataJSON.js