/
.gitlab-ci.yml
137 lines (125 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
image: registry.gitlab.com/nameserver-systems/images/ci/go
variables:
REPO_NAME: gitlab.com/nameserver-systems/pdns-distribute
stages:
- test
- inspect
- build
- deploy
workflow:
rules:
- when: always
.go-cache:
variables:
GOPATH: $CI_PROJECT_DIR/.go
before_script:
- mkdir -p .go
- make download-dep
cache:
paths:
- .go/pkg/mod/
test:
stage: test
extends: .go-cache
rules:
- when: always
script:
- make test
golinting:
stage: inspect
extends: .go-cache
allow_failure: false
rules:
- when: always
script:
- make golangci-all
check-shell-scripts:
stage: inspect
allow_failure: false
rules:
- when: always
script:
- make check-shell-scripts
main-build:
stage: build
before_script:
- make download-dep
allow_failure: false
rules:
- if: '$CI_COMMIT_TAG'
when: never
- when: always
artifacts:
expire_in: 1h
paths:
- bin/*
script:
- make pre-build
production-build:
stage: build
before_script:
- make download-dep
resource_group: binary-production
allow_failure: false
rules:
- if: '$CI_COMMIT_TAG'
when: always
artifacts:
expire_in: 1h
paths:
- bin/
script:
- make release
deploy-production:
stage: deploy
resource_group: binary-production
needs: [ "production-build" ]
dependencies:
- production-build
allow_failure: false
rules:
- if: '$CI_COMMIT_TAG'
when: always
script:
- "lftp -c \"set ftp:ssl-force true; set ssl:verify-certificate true; open -u $FTPS_USER_REPO,$FTPS_PW_REPO $FTPS_HOST_REPO; mirror --verbose --include-glob='*.deb' --include-glob='*.txt' --reverse --no-recursion --delete bin/ ./latest/; bye\" "
- "lftp -c \"set ftp:ssl-force true; set ssl:verify-certificate true; open -u $FTPS_USER_REPO,$FTPS_PW_REPO $FTPS_HOST_REPO; mirror --verbose --include-glob='*.deb' --include-glob='*.txt' --include-glob='*.tar.gz' --reverse --no-recursion --delete bin/ ./archive/$CI_COMMIT_TAG/; bye\" "
make-documentation:
image: registry.gitlab.com/nameserver-systems/images/ci/python
stage: build
resource_group: doc-production
rules:
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
when: always
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- "**/*.md"
- "mkdocs.yml"
- "poetry.lock"
- "pyproject.toml"
when: always
artifacts:
expire_in: 1h
paths:
- site/
script:
- "poetry install --no-dev"
- "poetry run mkdocs build --clean --strict"
deploy-documentation:
image: registry.gitlab.com/nameserver-systems/images/ci/python
stage: deploy
resource_group: doc-production
needs: [ "make-documentation" ]
dependencies:
- make-documentation
rules:
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
when: always
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
changes:
- "**/*.md"
- "mkdocs.yml"
- "poetry.lock"
- "pyproject.toml"
when: always
script:
- "lftp -c \"set ftp:ssl-force true; set ssl:verify-certificate false; open -u $FTPS_USER_DOC,$FTPS_PW_DOC $FTPS_HOST_DOC; mirror --verbose --reverse --delete site/ ./; bye\" "