s3:client: Link smbspool_krb5_wrapper against krb5samba
[samba.git] / .gitlab-ci.yml
1 # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
2
3 stages:
4   - images
5   - build
6   - report
7
8 variables:
9   GIT_STRATEGY: fetch
10   GIT_DEPTH: "3"
11   # "--enable-coverage" or ""
12   SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: ""
13   #
14   # we run autobuild.py inside a samba CI docker image located on gitlab's registry
15   # overwrite this variable if you want use your own image registry.
16   #
17   # Or better ask for access to the shared development repository, see
18   # https://wiki.samba.org/index.php/Samba_CI_on_gitlab#Getting_Access
19   #
20   SAMBA_CI_CONTAINER_REGISTRY: registry.gitlab.com/samba-team/devel/samba
21   #
22   # Set this to the contents of bootstrap/sha1sum.txt
23   # which is generated by bootstrap/template.py --render
24   #
25   SAMBA_CI_CONTAINER_TAG: a50a08a6ecfbe1113f3892c0cb3e2646d58a1521
26   #
27   # We use the ubuntu1804 image as default as
28   # it matches what we have on sn-devel-184.
29   #
30   SAMBA_CI_CONTAINER_IMAGE: ubuntu1804
31   #
32   # The following images are available
33   # Please see the samba-o3 sections at the end of this file!
34   # We should run that for each available image
35   #
36   SAMBA_CI_CONTAINER_IMAGE_ubuntu1804: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1804:${SAMBA_CI_CONTAINER_TAG}
37   SAMBA_CI_CONTAINER_IMAGE_ubuntu1604: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
38   SAMBA_CI_CONTAINER_IMAGE_debian9: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian9:${SAMBA_CI_CONTAINER_TAG}
39   SAMBA_CI_CONTAINER_IMAGE_opensuse150: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse150:${SAMBA_CI_CONTAINER_TAG}
40   SAMBA_CI_CONTAINER_IMAGE_fedora29: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora29:${SAMBA_CI_CONTAINER_TAG}
41   SAMBA_CI_CONTAINER_IMAGE_centos7: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos7:${SAMBA_CI_CONTAINER_TAG}
42
43 include:
44   # The image creation details are specified in a separate file
45   # See bootstrap/README.md for details
46   - 'bootstrap/.gitlab-ci.yml'
47
48 .shared_template:
49   variables:
50     AUTOBUILD_JOB_NAME: $CI_JOB_NAME
51   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
52   stage: build
53   tags:
54     - docker
55     - shared
56   before_script:
57     - uname -a
58     - lsb_release -a
59     - cat /etc/os-release
60     - mount
61     - df -h
62     - cat /proc/swaps
63     - free -h
64       # ld will fail if coverage enabled, force link ld to ld.bfd
65     - if [ -n "$SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE" ]; then sudo ln -sf $(which ld.bfd) $(which ld); fi
66       # See bootstrap/.gitlab-ci.yml how to generate a new image
67     - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
68     - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
69     - bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
70     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
71     - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
72     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
73     - diff -u bootstrap/sha1sum.txt /sha1sum.txt
74   after_script:
75     - mount
76     - df -h
77     - cat /proc/swaps
78     - free -h
79   artifacts:
80     expire_in: 1 week
81     paths:
82       - "*.stdout"
83       - "*.stderr"
84       - "*.info"
85       - system-info.txt
86   retry:
87     max: 2
88     when:
89       - runner_system_failure
90       - stuck_or_timeout_failure
91   script:
92     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
93     # autobuild name, which means we can define a default template that runs most autobuild jobs
94     - echo "Running cmd script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
95     - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE  --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
96
97 others:
98   extends: .shared_template
99   script:
100     - script/autobuild.py ldb     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
101     - script/autobuild.py pidl    $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
102     - script/autobuild.py replace $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
103     - script/autobuild.py talloc  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
104     - script/autobuild.py tdb     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
105     - script/autobuild.py tevent  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
106
107 samba:
108   extends: .shared_template
109
110 samba-none-env:
111   extends: .shared_template
112
113 samba-nopython:
114   extends: .shared_template
115
116 samba-nopython-py2:
117   extends: .shared_template
118
119 samba-systemkrb5:
120   extends: .shared_template
121
122 samba-xc:
123   extends: .shared_template
124
125 samba-ad-member:
126   extends: .shared_template
127
128 samba-ad-dc-2:
129   extends: .shared_template
130
131 samba-ad-dc-3:
132   extends: .shared_template
133
134 samba-ad-dc-4:
135   extends: .shared_template
136
137 samba-ad-dc-5:
138   extends: .shared_template
139
140 samba-ad-dc-6:
141   extends: .shared_template
142
143 samba-ad-dc-backup:
144   extends: .shared_template
145
146 samba-libs:
147   extends: .shared_template
148
149 samba-static:
150   extends: .shared_template
151
152 ctdb:
153   extends: .shared_template
154
155 samba-ctdb:
156   extends: .shared_template
157
158 samba-ad-dc-ntvfs:
159   extends: .shared_template
160
161 .private_template:
162   extends: .shared_template
163   tags:
164     - docker
165     - samba-ci-private
166   only:
167     variables:
168       # These jobs are only run if the gitlab repo has private runners available.
169       # To enable private jobs, you must add the following var and value to
170       # your gitlab repo by navigating to:
171       # settings -> CI/CD -> Environment variables
172       - $SUPPORT_PRIVATE_TEST == "yes"
173
174 samba-fileserver:
175   extends: .private_template
176
177 samba-ad-dc-1:
178   extends: .private_template
179
180 samba-nt4:
181   extends: .private_template
182
183 samba-schemaupgrade:
184   extends: .private_template
185
186 # 'pages' is a special job which can publish artifacts in `public` dir to gitlab pages
187 pages:
188   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
189   stage: report
190   tags:
191     - docker
192     - shared
193   dependencies:  # tell gitlab to download artifacts for these jobs
194     - samba
195     - samba-ad-dc-1
196     - samba-ad-dc-2
197     - samba-ad-dc-3
198     - samba-ad-dc-4
199     - samba-ad-dc-5
200     - samba-ad-dc-6
201     - samba-ad-dc-backup
202     - samba-ad-dc-ntvfs
203     - samba-ad-member
204     - samba-ctdb
205     - samba-fileserver
206     - samba-libs
207     - samba-none-env
208     - samba-nopython
209     - samba-nopython-py2
210     - samba-nt4
211     - samba-schemaupgrade
212     - samba-static
213     - samba-systemkrb5
214     - samba-xc
215     # - ctdb  # TODO
216     - others
217   script:
218     - ./configure.developer
219     - make -j
220     - lcov $(ls *.info | xargs -I{} echo -n "-a {} ") -o all.info
221     - genhtml all.info --output-directory public --prefix=$(pwd) --title "coverage report for $CI_COMMIT_REF_NAME $CI_COMMIT_SHORT_SHA"
222   artifacts:
223     expire_in: 30 days
224     paths:
225       - public
226   only:
227     variables:
228       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == "--enable-coverage"
229
230 #
231 # We build samba-o3 on all supported distributions
232 #
233
234 .samba-o3-template:
235   extends: .shared_template
236   variables:
237     AUTOBUILD_JOB_NAME: samba-o3
238   only:
239     variables:
240       # do not run o3 for coverage since they are using different images
241       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
242
243 ubuntu1804-samba-o3:
244   extends: .samba-o3-template
245   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1804
246
247 ubuntu1604-samba-o3:
248   extends: .samba-o3-template
249   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1604
250
251 debian9-samba-o3:
252   extends: .samba-o3-template
253   image: $SAMBA_CI_CONTAINER_IMAGE_debian9
254
255 opensuse150-samba-o3:
256   extends: .samba-o3-template
257   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse150
258
259 centos7-samba-o3:
260   extends: .samba-o3-template
261   image: $SAMBA_CI_CONTAINER_IMAGE_centos7
262   variables:
263     # Git on CentOS doesn't support shallow git cloning
264     GIT_DEPTH: ""
265
266 fedora29-samba-o3:
267   extends: .samba-o3-template
268   image: $SAMBA_CI_CONTAINER_IMAGE_fedora29
269
270 #
271 # Keep the samba-o3 sections at the end ...
272 #