-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
105 lines (94 loc) · 2.71 KB
/
.gitlab-ci.yml
File metadata and controls
105 lines (94 loc) · 2.71 KB
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
variables:
ANSIBLE_FORCE_COLOR: 'true'
stages:
- test
- build-and-deploy
.run_on_dockerhost: &run_on_dockerhost
tags:
- docker20
image: "${DOCKER_ACCESS_URL}/other/dockerdev/documentation:latest"
linkcheck:
<<: *run_on_dockerhost
stage: test
variables:
SPHINX_IGNORE_EXTERNAL_LINKS: "true"
script:
- python3 -msphinx -W --keep-going -b linkcheck . _build/linkcheck
linkcheck_external:
<<: *run_on_dockerhost
stage: test
script:
- python3 -msphinx -W --keep-going -b linkcheck . _build/linkcheck
allow_failure: true
spellcheck:
<<: *run_on_dockerhost
stage: test
script:
- python3 --version
- pip freeze
- python3 -msphinx -W --keep-going -b spelling . _build/spelling
build:
<<: *run_on_dockerhost
stage: test
script:
- sphinx-build -W --keep-going -b html . _build/html
artifacts:
paths:
- _build/html/**/*
deploy:
<<: *run_on_dockerhost
stage: build-and-deploy
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: on_success
- when: never
script:
- sphinx-build -b html . _build/html
- bash load_ssh_key_for_deploy.sh
- rsync -rt _build/html/ support@data.aimms.com:/home/aimms/www/documentation.aimms.com
retry: 1
internal_documentation_deploy:
<<: *run_on_dockerhost
stage: build-and-deploy
script:
- sphinx-build -b html . _build/html
- bash load_ssh_key_for_deploy.sh
- ssh support@data.aimms.com mkdir -p /home/aimms/www/documentation-staging/${CI_COMMIT_BRANCH}
- rsync -r --omit-dir-times --delete-excluded _build/html/ support@data.aimms.com:/home/aimms/www/documentation-staging/${CI_COMMIT_BRANCH}
az_deploy:
<<: *run_on_dockerhost
stage: build-and-deploy
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: on_success
- when: never
script:
- sphinx-build -b html . _build/html
- az storage copy -s '_build/html' --recursive --destination-container '$web' -- --overwrite=true --as-subdir=false
upload_html_to_rfx_blob:
<<: *run_on_dockerhost
stage: build-and-deploy
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: on_success
- when: never
script:
- sphinx-build -b html . _build/html
- mkdir -p _build/flat
- |
set -eo pipefail
find _build/html -name "*.html" -print0 | while IFS= read -r -d '' f; do
parent=$(basename "$(dirname "$f")")
filename=$(basename "$f")
if [ "$parent" = "html" ]; then
cp "$f" "_build/flat/$filename"
else
cp "$f" "_build/flat/${parent}-${filename}"
fi
done
- >
az storage blob sync
--connection-string "$RALFXPROJECT_CONNECTION_STRING"
--container rfx-aimms-doc
--source _build/flat
--delete-destination true