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