gitlab-ci: Enable building on CentOS7
[amitay/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
7 variables:
8   GIT_STRATEGY: fetch
9   GIT_DEPTH: "3"
10   #
11   # we run autobuild.py inside a samba CI docker image located on gitlab's registry
12   # overwrite this variable if you want use your own image registry.
13   #
14   # Or better ask for access to the shared development repository, see
15   # https://wiki.samba.org/index.php/Samba_CI_on_gitlab#Getting_Access
16   #
17   SAMBA_CI_CONTAINER_REGISTRY: registry.gitlab.com/samba-team/devel/samba
18   #
19   # Set this to the contents of bootstrap/sha1sum.txt
20   # which is generated by bootstrap/template.py --render
21   #
22   SAMBA_CI_CONTAINER_TAG: 93278680b4e7086c0bec11a58bc3533f9971c08e
23   # We use the ubuntu1804 image as default as
24   # it matches what we have on sn-devel-184.
25   SAMBA_CI_CONTAINER_IMAGE: ubuntu1804
26   #
27   # The following images are available
28   # Please see the samba-o3 sections at the end of this file!
29   # We should run that for each available image
30   #
31   SAMBA_CI_CONTAINER_IMAGE_ubuntu1804: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1804:${SAMBA_CI_CONTAINER_TAG}
32   SAMBA_CI_CONTAINER_IMAGE_ubuntu1604: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
33   SAMBA_CI_CONTAINER_IMAGE_debian9: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian9:${SAMBA_CI_CONTAINER_TAG}
34   SAMBA_CI_CONTAINER_IMAGE_opensuse150: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse150:${SAMBA_CI_CONTAINER_TAG}
35   SAMBA_CI_CONTAINER_IMAGE_fedora29: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora29:${SAMBA_CI_CONTAINER_TAG}
36   SAMBA_CI_CONTAINER_IMAGE_centos7: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos7:${SAMBA_CI_CONTAINER_TAG}
37
38 include:
39   # The image creation details are specified in a separate file
40   # See bootstrap/README.md for details
41   - 'bootstrap/.gitlab-ci.yml'
42
43 .shared_template:
44   variables:
45     AUTOBUILD_JOB_NAME: $CI_JOB_NAME
46   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
47   stage: build
48   tags:
49     - docker
50     - shared
51   before_script:
52     - uname -a
53     - lsb_release -a
54     - cat /etc/os-release
55     - mount
56     - df -h
57     - cat /proc/swaps
58     - free -h
59       # See bootstrap/.gitlab-ci.yml how to generate a new image
60     - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
61     - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
62     - bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
63     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
64     - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
65     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
66     - diff -u bootstrap/sha1sum.txt /sha1sum.txt
67   after_script:
68     - mount
69     - df -h
70     - cat /proc/swaps
71     - free -h
72   artifacts:
73     expire_in: 1 week
74     when: on_failure
75     paths:
76       - "*.stdout"
77       - "*.stderr"
78       - system-info.txt
79   retry:
80     max: 2
81     when:
82       - runner_system_failure
83       - stuck_or_timeout_failure
84   script:
85     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
86     # autobuild name, which means we can define a default template that runs most autobuild jobs
87     - echo "Running cmd script/autobuild.py $AUTOBUILD_JOB_NAME --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
88     - script/autobuild.py $AUTOBUILD_JOB_NAME    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
89
90 others:
91   extends: .shared_template
92   script:
93     - script/autobuild.py ldb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
94     - script/autobuild.py pidl             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
95     - script/autobuild.py replace          --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
96     - script/autobuild.py talloc           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
97     - script/autobuild.py tdb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
98     - script/autobuild.py tevent           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
99
100 samba:
101   extends: .shared_template
102
103 samba-none-env:
104   extends: .shared_template
105
106 samba-nopython:
107   extends: .shared_template
108
109 samba-nopython-py2:
110   extends: .shared_template
111
112 samba-systemkrb5:
113   extends: .shared_template
114
115 samba-xc:
116   extends: .shared_template
117
118 samba-ad-member:
119   extends: .shared_template
120
121 samba-ad-dc-2:
122   extends: .shared_template
123
124 samba-ad-dc-3:
125   extends: .shared_template
126
127 samba-ad-dc-4:
128   extends: .shared_template
129
130 samba-ad-dc-5:
131   extends: .shared_template
132
133 samba-ad-dc-6:
134   extends: .shared_template
135
136 samba-ad-dc-backup:
137   extends: .shared_template
138
139 samba-libs:
140   extends: .shared_template
141
142 samba-static:
143   extends: .shared_template
144
145 ctdb:
146   extends: .shared_template
147
148 samba-ctdb:
149   extends: .shared_template
150
151 samba-ad-dc-ntvfs:
152   extends: .shared_template
153
154 .private_template:
155   extends: .shared_template
156   tags:
157     - docker
158     - samba-ci-private
159   only:
160     variables:
161       # These jobs are only run if the gitlab repo has private runners available.
162       # To enable private jobs, you must add the following var and value to
163       # your gitlab repo by navigating to:
164       # settings -> CI/CD -> Environment variables
165       - $SUPPORT_PRIVATE_TEST == "yes"
166
167 samba-fileserver:
168   extends: .private_template
169
170 samba-ad-dc-1:
171   extends: .private_template
172
173 samba-nt4:
174   extends: .private_template
175
176 samba-schemaupgrade:
177   extends: .private_template
178
179 #
180 # We build samba-o3 on all supported distributions
181 #
182
183 .samba-o3-template:
184   extends: .shared_template
185   variables:
186     AUTOBUILD_JOB_NAME: samba-o3
187
188 ubuntu1804-samba-o3:
189   extends: .samba-o3-template
190   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1804
191
192 ubuntu1604-samba-o3:
193   extends: .samba-o3-template
194   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1604
195
196 debian9-samba-o3:
197   extends: .samba-o3-template
198   image: $SAMBA_CI_CONTAINER_IMAGE_debian9
199
200 opensuse150-samba-o3:
201   extends: .samba-o3-template
202   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse150
203
204 centos7-samba-o3:
205   extends: .samba-o3-template
206   image: $SAMBA_CI_CONTAINER_IMAGE_centos7
207   variables:
208     # Git on CentOS doesn't support shallow git cloning
209     GIT_DEPTH: ""
210
211 fedora29-samba-o3:
212   extends: .samba-o3-template
213   image: $SAMBA_CI_CONTAINER_IMAGE_fedora29
214
215 #
216 # Keep the samba-o3 sections at the end ...
217 #