.gitlab-ci.yml: split AUTOBUILD_JOB_NAME from CI_JOB_NAME
[gd/samba-autobuild/.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: 8606e89b0ce6a916fa881549a6cebf6eed528157
23   #
24   # Be use the ubuntu1404 image as it matches what we
25   # have on sn-devel-144.
26   #
27   SAMBA_CI_CONTAINER_IMAGE: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1404:${SAMBA_CI_CONTAINER_TAG}
28
29 include:
30   # The image creation details are specified in a separate file
31   # See bootstrap/README.md for details
32   - 'bootstrap/.gitlab-ci.yml'
33
34 .shared_template:
35   variables:
36     AUTOBUILD_JOB_NAME: $CI_JOB_NAME
37   image: $SAMBA_CI_CONTAINER_IMAGE
38   stage: build
39   tags:
40     - docker
41     - shared
42   before_script:
43     - uname -a
44     - lsb_release -a
45     - cat /etc/os-release
46     - mount
47     - df -h
48     - cat /proc/swaps
49     - free -h
50       # See bootstrap/.gitlab-ci.yml how to generate a new image
51     - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
52     - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
53     - bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
54     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
55     - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
56     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
57     - diff -u bootstrap/sha1sum.txt /sha1sum.txt
58   after_script:
59     - mount
60     - df -h
61     - cat /proc/swaps
62     - free -h
63   artifacts:
64     expire_in: 1 week
65     when: on_failure
66     paths:
67       - "*.stdout"
68       - "*.stderr"
69       - system-info.txt
70       - /tmp/samba-testbase/*/*/bin/config.log
71   retry:
72     max: 2
73     when:
74       - runner_system_failure
75       - stuck_or_timeout_failure
76   script:
77     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
78     # autobuild name, which means we can define a default template that runs most autobuild jobs
79     - echo "Running cmd script/autobuild.py $AUTOBUILD_JOB_NAME --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
80     - script/autobuild.py $AUTOBUILD_JOB_NAME    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
81
82 others:
83   extends: .shared_template
84   script:
85     - script/autobuild.py ldb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
86     - script/autobuild.py pidl             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
87     - script/autobuild.py replace          --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
88     - script/autobuild.py talloc           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
89     - script/autobuild.py tdb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
90     - script/autobuild.py tevent           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
91
92 samba:
93   extends: .shared_template
94
95 samba-none-env:
96   extends: .shared_template
97
98 samba-nopython:
99   extends: .shared_template
100
101 samba-nopython-py2:
102   extends: .shared_template
103
104 samba-systemkrb5:
105   extends: .shared_template
106
107 samba-xc:
108   extends: .shared_template
109
110 samba-o3:
111   extends: .shared_template
112
113 samba-ad-member:
114   extends: .shared_template
115
116 samba-ad-dc-2:
117   extends: .shared_template
118
119 samba-ad-dc-3:
120   extends: .shared_template
121
122 samba-ad-dc-4:
123   extends: .shared_template
124
125 samba-ad-dc-5:
126   extends: .shared_template
127
128 samba-ad-dc-6:
129   extends: .shared_template
130
131 samba-ad-dc-backup:
132   extends: .shared_template
133
134 samba-libs:
135   extends: .shared_template
136
137 samba-static:
138   extends: .shared_template
139
140 ctdb:
141   extends: .shared_template
142
143 samba-ctdb:
144   extends: .shared_template
145
146 samba-ad-dc-ntvfs:
147   extends: .shared_template
148
149 .private_template:
150   extends: .shared_template
151   tags:
152     - docker
153     - private
154     - samba-ci-private
155   only:
156     variables:
157       # These jobs are only run if the gitlab repo has private runners available.
158       # To enable private jobs, you must add the following var and value to
159       # your gitlab repo by navigating to:
160       # settings -> CI/CD -> Environment variables
161       - $SUPPORT_PRIVATE_TEST == "yes"
162
163 samba-fileserver:
164   extends: .private_template
165
166 samba-ad-dc-1:
167   extends: .private_template
168
169 samba-nt4:
170   extends: .private_template
171
172 samba-schemaupgrade:
173   extends: .private_template