-
Notifications
You must be signed in to change notification settings - Fork 21
/
.gitlab-ci.yml
76 lines (72 loc) · 1.87 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
stages:
- build
- preview
- deploy
build:
stage: build
image:
name: $CI_REGISTRY/linbit/linbit-documentation
entrypoint: [""]
rules:
- if: $CI_MERGE_REQUEST_ID
script:
- make UG9-html-finalize
artifacts:
paths:
- UG9/en/output-html-finalize/*.zip
lint:
stage: build
image:
name: $LINBIT_DOCKER_REGISTRY/lb-vale:latest
entrypoint: [""]
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH == 'master'
script:
- /bin/vale --config=/vale_app/.vale.ini --no-exit --output=JSON **/en/*.adoc | tee vale.json
- /bin/vale2climate vale.json > vale-climate.json
artifacts:
paths:
- vale.json
when: always
reports:
codequality:
- vale-climate.json
preview:
stage: preview
image: $LINBIT_DOCKER_REGISTRY/ug-preview:latest
rules:
- if: $CI_MERGE_REQUEST_ID
environment:
name: preview/$CI_COMMIT_REF_SLUG
url: $LINBIT_REGISTRY_URL/repository/pages/$CI_COMMIT_REF_SLUG/
script:
- zips=$(realpath ./UG9/en/output-html-finalize/*.zip)
- mkdir /index
- cd /build
- |
for zip in $zips; do
prefix=$(basename $zip .zip)
php linbit-drbd.php $zip /out
./upload.sh $CI_COMMIT_REF_SLUG /out $prefix
echo "<a href='./$prefix/'><h2>$prefix</h2></a>" >> /index/index.html
done
./upload.sh $CI_COMMIT_REF_SLUG /index .
dependencies:
- build
deploy:
stage: deploy
image:
name: $CI_REGISTRY/linbit/linbit-documentation
entrypoint: [""]
rules:
- if: $CI_COMMIT_BRANCH == 'master'
before_script:
- echo "DEPLOY"
script:
- mkdir -p ~/src && cp -r . ~/src && cd ~/src
- cp /linbit-documentation/GNUmakefile .
- cp -r /fonts .
- make trusthosts all-clean DOCKER=no SFTPUSER=$SFTPUSERSTAGING STAGING=yes
- make trusthosts all DOCKER=no SFTPUSER=$SFTPUSER SKIPGENERATE=yes
- make g-upload-ug-pdfs