-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
.gitlab-ci.yml
89 lines (82 loc) · 2.17 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
stages:
- build_html
- deploy
- deploy_prod
# CI_COMMIT_REF_NAME could be a tag name, and in this case VERSION and TX_BRANCH
# cannot be set correctly, so we don't build and deploy on tags
before_script:
- export VERSION=$(echo -n $CI_COMMIT_REF_NAME | sed 's/^lizmap\_\([0-9][0-9]*\)\_\([0-9][0-9]*\)$/\1.\2/g')
- if [ "$VERSION" == "master" ]; then export VERSION="next"; fi
- export TX_BRANCH="$CI_COMMIT_REF_NAME"
- echo "VERSION=$VERSION TX_BRANCH=$TX_BRANCH"
# Build without translations, for MR
build_html_mr:
only:
- merge_requests
stage: build_html
script:
- make clean html SPHINXBUILD=sphinx-build SPHINXINTL=sphinx-intl
artifacts:
paths:
- build/html/
name: "lizmapdoc-$CI_COMMIT_REF_NAME"
tags:
- infrav2
# Build with translations, for main branches
build_html_i18n:
only:
- master
- lizmap_3_8
- lizmap_3_7
stage: build_html
script:
- ./update_from_transifex.sh -f
- make clean html SPHINXBUILD=sphinx-build SPHINXINTL=sphinx-intl
artifacts:
paths:
- build/html/
name: "lizmapdoc-$CI_COMMIT_REF_NAME"
tags:
- infrav2
push_transifex:
only:
- master
- lizmap_3_8
- lizmap_3_7
stage: build_html
script:
- make gettext SPHINXBUILD=sphinx-build SPHINXINTL=sphinx-intl
- tx -H $TX_API -t $TX_TOKEN push -s
tags:
- infrav2
deploy_snap:
only:
- master
- lizmap_3_8
- lizmap_3_7
stage: deploy
dependencies:
- build_html_i18n
script:
- rsync -e "$DEPLOYDOC_SNAP_SSH_PARAM" -P -rvvzc --delete build/html/ $DEPLOYDOC_SNAP_HOST:$DEPLOYDOC_SNAP_PATH/$VERSION
- rsync -e "$DEPLOYDOC_SNAP_SSH_PARAM" -P -rvvzc static/ $DEPLOYDOC_SNAP_HOST:$DEPLOYDOC_SNAP_PATH/
environment:
name: snap
tags:
- infrav2
deploy_production:
only:
- master
- lizmap_3_8
- lizmap_3_7
stage: deploy_prod
dependencies:
- build_html_i18n
script:
- rsync -e "$DEPLOYDOC_PROD_SSH_PARAM" -P -rvzc --delete build/html/ $DEPLOYDOC_PROD_HOST:$DEPLOYDOC_PROD_PATH/$VERSION
- rsync -e "$DEPLOYDOC_PROD_SSH_PARAM" -P -rvzc static/ $DEPLOYDOC_PROD_HOST:$DEPLOYDOC_PROD_PATH/
environment:
name: production
when: manual
tags:
- infrav2