-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
69 lines (63 loc) · 2.48 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
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- test
- build
- pdf
.run_on_dockerhost: &run_on_dockerhost
tags:
- docker20
before_script:
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
image: gitlab.aimms.com:5050/other/dockerdev/documentation:latest
linkcheck:
<<: *run_on_dockerhost
stage: test
script:
- python3 -msphinx -W -b linkcheck . _build/linkcheck
build_and_staging:
<<: *run_on_dockerhost
stage: build
rules:
- if: $CI_COMMIT_TAG # no pipelines on tags
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"' #when a merge request is active, all pushes trigger two pipelines if we allow this one
when: never
- if: '$CI_COMMIT_BRANCH != "master"'
when: always
- when: never
script:
- sphinx-build -M html . _build
- bash load_ssh_key_for_deploy.sh
- ssh [email protected] mkdir -p /home/aimms/www/functional-reference-staging/${CI_COMMIT_BRANCH}
- rsync -r --omit-dir-times --delete-excluded _build/html/ [email protected]:/home/aimms/www/functional-reference-staging/${CI_COMMIT_BRANCH}
build_and_install:
<<: *run_on_dockerhost
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: always
- when: never
script:
- python3 -msphinx -W -b html . _build/html
- python3 -msphinx.ext.intersphinx _build/html/objects.inv > _build/html/help_index_functionreference.txt
- cp -r _build/html functionreference
- az storage copy -s 'functionreference' --recursive --destination-container '$web' -- --overwrite=true --as-subdir=true
- bash load_ssh_key_for_deploy.sh
- rsync -rt --delete-excluded _build/html/ [email protected]:/home/aimms/www/documentation.aimms.com/functionreference
compile_PDF:
<<: *run_on_dockerhost
stage: pdf
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: always
- when: never
script:
- python3 -msphinx -M latex . _build
- python3 -msphinx -M latexpdf . _build
- mkdir -p functionreference && cp _build/latex/AIMMS_func.pdf functionreference/AIMMS_func.pdf
- az storage copy -s 'functionreference' --recursive --destination-container '$web' -- --overwrite=true --as-subdir=true
- bash load_ssh_key_for_deploy.sh
- rsync -rt _build/latex/AIMMS_func.pdf [email protected]:/home/aimms/www/documentation.aimms.com/functionreference
- rsync -rt _build/latex/AIMMS_func.pdf [email protected]:/home/aimms/www/data/download/manuals
allow_failure: true