idmap_hash: remember new domain sids in idmap_hash_sid_to_id()
[metze/samba/wip.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: 4a498d9dd6c861b85bf4a749f3feb0805ea7298e
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_opensuse151: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse151:${SAMBA_CI_CONTAINER_TAG}
41   SAMBA_CI_CONTAINER_IMAGE_fedora29: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora29:${SAMBA_CI_CONTAINER_TAG}
42   SAMBA_CI_CONTAINER_IMAGE_fedora30: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora30:${SAMBA_CI_CONTAINER_TAG}
43   SAMBA_CI_CONTAINER_IMAGE_centos7: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos7:${SAMBA_CI_CONTAINER_TAG}
44   SAMBA_CI_CONTAINER_IMAGE_centos8: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos8:${SAMBA_CI_CONTAINER_TAG}
45
46 include:
47   # The image creation details are specified in a separate file
48   # See bootstrap/README.md for details
49   - 'bootstrap/.gitlab-ci.yml'
50
51 .shared_template:
52   variables:
53     AUTOBUILD_JOB_NAME: $CI_JOB_NAME
54   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
55   stage: build
56   tags:
57     - docker
58     - shared
59   before_script:
60     - uname -a
61     - lsb_release -a
62     - cat /etc/os-release
63     - mount
64     - df -h
65     - cat /proc/swaps
66     - free -h
67       # ld will fail if coverage enabled, force link ld to ld.bfd
68     - if [ -n "$SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE" ]; then sudo ln -sf $(which ld.bfd) $(which ld); fi
69       # See bootstrap/.gitlab-ci.yml how to generate a new image
70     - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
71     - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
72     - bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
73     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
74     - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
75     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
76     - diff -u bootstrap/sha1sum.txt /sha1sum.txt
77   after_script:
78     - mount
79     - df -h
80     - cat /proc/swaps
81     - free -h
82   artifacts:
83     expire_in: 1 week
84     paths:
85       - "*.stdout"
86       - "*.stderr"
87       - "*.info"
88       - system-info.txt
89   retry:
90     max: 2
91     when:
92       - runner_system_failure
93       - stuck_or_timeout_failure
94   script:
95     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
96     # autobuild name, which means we can define a default template that runs most autobuild jobs
97     - echo "Running cmd script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
98     - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE  --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
99
100 others:
101   extends: .shared_template
102   script:
103     - script/autobuild.py ldb     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
104     - script/autobuild.py pidl    $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
105     - script/autobuild.py replace $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
106     - script/autobuild.py talloc  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
107     - script/autobuild.py tdb     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
108     - script/autobuild.py tevent  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
109
110 samba:
111   extends: .shared_template
112
113 samba-none-env:
114   extends: .shared_template
115
116 samba-nopython:
117   extends: .shared_template
118
119 samba-nopython-py2:
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-libs:
144   extends: .shared_template
145
146 samba-static:
147   extends: .shared_template
148
149 ctdb:
150   extends: .shared_template
151
152 samba-ctdb:
153   extends: .shared_template
154
155 samba-ad-dc-ntvfs:
156   extends: .shared_template
157
158 samba-ad-member-mitkrb5:
159   extends: .shared_template
160
161 samba-ad-dc-4-mitkrb5:
162   extends: .shared_template
163
164 .private_template:
165   extends: .shared_template
166   tags:
167     - docker
168     - samba-ci-private
169   only:
170     variables:
171       # These jobs are only run if the gitlab repo has private runners available.
172       # To enable private jobs, you must add the following var and value to
173       # your gitlab repo by navigating to:
174       # settings -> CI/CD -> Environment variables
175       - $SUPPORT_PRIVATE_TEST == "yes"
176
177 samba-ad-dc-backup:
178   extends: .private_template
179
180 samba-simpleserver:
181   extends: .private_template
182
183 samba-fileserver:
184   extends: .private_template
185
186 samba-ad-dc-1:
187   extends: .private_template
188
189 samba-nt4:
190   extends: .private_template
191
192 samba-schemaupgrade:
193   extends: .private_template
194
195 samba-ad-dc-1-mitkrb5:
196   extends: .private_template
197
198 # 'pages' is a special job which can publish artifacts in `public` dir to gitlab pages
199 pages:
200   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
201   stage: report
202   tags:
203     - docker
204     - shared
205   dependencies:  # tell gitlab to download artifacts for these jobs
206     - samba
207     - samba-ad-dc-1
208     - samba-ad-dc-1-mitkrb5
209     - samba-ad-dc-2
210     - samba-ad-dc-3
211     - samba-ad-dc-4
212     - samba-ad-dc-4-mitkrb5
213     - samba-ad-dc-5
214     - samba-ad-dc-6
215     - samba-ad-dc-backup
216     - samba-ad-dc-ntvfs
217     - samba-ad-member
218     - samba-ad-member-mitkrb5
219     - samba-ctdb
220     - samba-fileserver
221     - samba-libs
222     - samba-none-env
223     - samba-nopython
224     - samba-nopython-py2
225     - samba-nt4
226     - samba-schemaupgrade
227     - samba-static
228     - samba-xc
229     # - ctdb  # TODO
230     - others
231   script:
232     - ./configure.developer
233     - make -j
234     - lcov $(ls *.info | xargs -I{} echo -n "-a {} ") -o all.info
235     - genhtml all.info --output-directory public --prefix=$(pwd) --title "coverage report for $CI_COMMIT_REF_NAME $CI_COMMIT_SHORT_SHA"
236   artifacts:
237     expire_in: 30 days
238     paths:
239       - public
240   only:
241     variables:
242       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == "--enable-coverage"
243
244 #
245 # We build samba-o3 on all supported distributions
246 #
247
248 .samba-o3-template:
249   extends: .shared_template
250   variables:
251     AUTOBUILD_JOB_NAME: samba-o3
252   only:
253     variables:
254       # do not run o3 for coverage since they are using different images
255       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
256
257 ubuntu1804-samba-o3:
258   extends: .samba-o3-template
259   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1804
260
261 ubuntu1604-samba-o3:
262   extends: .samba-o3-template
263   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1604
264
265 debian9-samba-o3:
266   extends: .samba-o3-template
267   image: $SAMBA_CI_CONTAINER_IMAGE_debian9
268
269 opensuse150-samba-o3:
270   extends: .samba-o3-template
271   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse150
272
273 opensuse151-samba-o3:
274   extends: .samba-o3-template
275   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse151
276
277 centos7-samba-o3:
278   extends: .samba-o3-template
279   image: $SAMBA_CI_CONTAINER_IMAGE_centos7
280   variables:
281     # Git on CentOS doesn't support shallow git cloning
282     GIT_DEPTH: ""
283     # We need a newer GnuTLS version on CentOS7
284     PKG_CONFIG_PATH: "/usr/lib64/compat-gnutls34/pkgconfig:/usr/lib64/compat-nettle32/pkgconfig"
285
286 centos8-samba-o3:
287   extends: .samba-o3-template
288   image: $SAMBA_CI_CONTAINER_IMAGE_centos8
289
290 fedora29-samba-o3:
291   extends: .samba-o3-template
292   image: $SAMBA_CI_CONTAINER_IMAGE_fedora29
293
294 fedora30-samba-o3:
295   extends: .samba-o3-template
296   image: $SAMBA_CI_CONTAINER_IMAGE_fedora30
297
298 #
299 # Keep the samba-o3 sections at the end ...
300 #