-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
112 lines (103 loc) · 3.18 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
image: docker.uib.gmbh/opsi/opsidoc-antora:bookworm
stages:
# - lint
- setup
- test
- build-and-publish
install:
stage: setup
cache:
paths:
- .cache/npm
script:
- &npm_install |
# Antora
npm install --no-audit --quiet --no-progress --cache=.cache/npm
# Antora-UI
cd antora-ui
npm install --no-audit --quiet --no-progress --cache=.cache/npm
cd ..
# .install_toolchain: &install_toolchain |
# npm config set fetch-retry-maxtimeout 360000 -g
# npm config set fetch-timeout 120000 -g
# npm config set fetch-retry-factor 10 -g
# npm config set fetch-retries 15 -g
# # Antora
# npm install --no-audit --quiet --no-progress --cache=.cache/npm
# # Antora-UI
# cd antora-ui
# npm install --no-audit --quiet --no-progress --cache=.cache/npm
# cd ..
.install_cspell: &install_cspell |
echo "Install cspell"
npm install -g cspell@latest
npm install -g @cspell/dict-de-de
cspell link add @cspell/dict-de-de
#lint-cspell:
# stage: lint
# script:
# - *install_cspell
#- cspell lint -c cspell.json docs/de/modules/server
#- cspell lint -c cspell.json docs/de/modules/clients
test-antora-build:
stage: test
script:
- git checkout $CI_COMMIT_REF_NAME
- git show --summary
- git show-ref --head
- sed -i "s#CURRENT_BRANCH#$CI_COMMIT_REF_NAME#g" head-playbook.yml
- *npm_install
- cd antora-ui
- gulp bundle
- gulp bundle:pack
- cd ..
- npx antora --log-level=debug --log-failure-level warn head-playbook.yml
except:
- v4.2
artifacts:
paths:
- build/test/site
expire_in: 2 hours
build-and-publish-docs-opsi-org:
stage: build-and-publish
script:
- *npm_install
- cd antora-ui
- gulp bundle
- gulp bundle:pack
- cd ..
- npx antora -v
- npx antora --log-level=debug antora-playbook.yml
- touch build/docs-opsi-org/site/index.html
- du -hs build/*
- 'which ssh-agent || (apt update && apt -y install openssh-client)'
- 'which rsync || (apt update && apt -y install rsync)'
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- ssh-add <(echo "$BLOG_PUBLISH_PRIVATE_KEY")
# rsync with delete to get rid of old artifacts. Exclude python-opsi[-common] to not remove them
- rsync -e "ssh -o StrictHostKeyChecking=no" --delete -azv build/docs-opsi-org/site/ [email protected]:/var/lib/docker/volumes/docs_nginx_data/_data/ --exclude=python-opsi --exclude=python-opsi-common
only:
- tags
build-and-publish-bonifax:
stage: build-and-publish
script:
- *npm_install
- cd antora-ui
- gulp bundle
- gulp bundle:pack
- cd ..
- npx antora -v
- npx antora --log-level=debug bonifax-playbook.yml
- touch build/bonifax/site/index.html
- du -hs build/*
- 'which ssh-agent || (apt update && apt install -y openssh-client)'
- 'which rsync || (apt update && apt install -y rsync)'
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- ssh-add <(echo "$DOCUSER_PRIVATE_KEY")
- rsync -e "ssh -o StrictHostKeyChecking=no" --delete -azv build/bonifax/site/* "$DOCUSER@$DOCSERVER:/home/opsi/doc/opsidoc/antora/" --exclude=python-opsi --exclude=python-opsi-common
only:
- v5
- v4.3
- tags