forked from 3liz/lizmap-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
89 lines (81 loc) · 1.81 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
stages:
- build_pot
- build_html
- deploy
# 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_pot:
only:
- schedules
stage: build_pot
script:
- make gettext
tags:
- infrav2
build_and_publish_pot:
except:
- schedules
- tags
stage: build_pot
script:
- make gettext
- tx push -s --no-interactive --branch $TX_BRANCH
tags:
- infrav2
retrieve_po_and_build:
only:
- schedules
stage: build_html
script:
- tx pull -l es,fi,fr,it,pt,ru --branch $TX_BRANCH
- make clean html
artifacts:
paths:
- build/html/
name: "lizmapdoc-$CI_COMMIT_REF_NAME"
tags:
- infrav2
build_html:
except:
- schedules
- tags
stage: build_html
script:
- make clean html
artifacts:
paths:
- build/html/
name: "lizmapdoc-$CI_COMMIT_REF_NAME"
tags:
- infrav2
deploy_snap:
stage: deploy
except:
- tags
dependencies:
- retrieve_po_and_build
- build_html
script:
- rsync -e "$DEPLOYDOC_SNAP_SSH_PARAM" -P -rvzc --delete build/html/ $DEPLOYDOC_SNAP_HOST:$DEPLOYDOC_SNAP_PATH/$VERSION
environment:
name: snap
tags:
- infrav2
deploy_production:
only:
- schedules
stage: deploy
dependencies:
- retrieve_po_and_build
script:
- rsync -e "$DEPLOYDOC_PROD_SSH_PARAM" -P -rvzc --delete build/html/ $DEPLOYDOC_PROD_HOST:$DEPLOYDOC_PROD_PATH/$VERSION
environment:
name: production
when: manual
tags:
- infrav2