autobuild: spread ad-dc tests over 6 autobuild/ci separate tasks/jobs
[samba.git] / .gitlab-ci.yml
1 # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
2
3
4 variables:
5   # we run autobuild.py inside a samba CI docker image located on gitlab's registry
6   SAMBA_CI_CONTAINER_REGISTRY: registry.gitlab.com
7   SAMBA_CI_CONTAINER_NAME: samba-team/samba
8   SAMBA_CI_CONTAINER_TAG: latest
9   SAMBA_CI_CONTAINER_IMAGE: $SAMBA_CI_CONTAINER_REGISTRY/$SAMBA_CI_CONTAINER_NAME:$SAMBA_CI_CONTAINER_TAG
10   GIT_STRATEGY: fetch
11   GIT_DEPTH: "3"
12
13 .shared_template:
14   image: $SAMBA_CI_CONTAINER_IMAGE
15   stage: build
16   tags:
17     - docker
18     - shared
19   before_script:
20     - uname -a
21     - lsb_release -a
22     - echo "Build starting (preparing swap)..."
23     - if [ $(df -m / --output=avail | tail -n1) -gt 10240 ]; then
24         sudo dd if=/dev/zero of=/samba-swap bs=1M count=6144;
25         sudo mkswap /samba-swap;
26         sudo swapon /samba-swap;
27       fi
28     - mount
29     - df -h
30     - free -h
31   artifacts:
32     expire_in: 1 week
33     when: on_failure
34     paths:
35       - "*.stdout"
36       - "*.stderr"
37       - system-info.txt
38       - /tmp/samba-testbase/*/*/bin/config.log
39   retry:
40     max: 2
41     when:
42       - runner_system_failure
43       - stuck_or_timeout_failure
44   script:
45     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
46     # autobuild name, which means we can define a default template that runs most autobuild jobs
47     - echo "Running cmd script/autobuild.py $CI_JOB_NAME --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
48     - script/autobuild.py $CI_JOB_NAME    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
49
50 others:
51   extends: .shared_template
52   script:
53     - script/autobuild.py ldb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
54     - script/autobuild.py pidl             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
55     - script/autobuild.py replace          --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
56     - script/autobuild.py talloc           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
57     - script/autobuild.py tdb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
58     - script/autobuild.py tevent           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
59
60 samba-none-env:
61   extends: .shared_template
62   # this one takes about 1 hours to finish
63
64 samba-nopython:
65   extends: .shared_template
66
67 samba-nopython-py2:
68   extends: .shared_template
69
70 samba-systemkrb5:
71   extends: .shared_template
72
73 samba-xc:
74   extends: .shared_template
75
76 samba-o3:
77   extends: .shared_template
78
79 samba-ad-member:
80   extends: .shared_template
81
82 samba-ad-dc-2:
83   extends: .shared_template
84
85 samba-ad-dc-3:
86   extends: .shared_template
87
88 samba-ad-dc-4:
89   extends: .shared_template
90
91 samba-ad-dc-5:
92   extends: .shared_template
93
94 samba-ad-dc-6:
95   extends: .shared_template
96
97 samba-ad-dc-backup:
98   extends: .shared_template
99
100 samba-libs:
101   extends: .shared_template
102
103 samba-static:
104   extends: .shared_template
105
106 ctdb:
107   extends: .shared_template
108
109 samba-ctdb:
110   extends: .shared_template
111
112 samba-ad-dc-ntvfs:
113   extends: .shared_template
114   # this one takes about 100 mins to finish
115
116
117 .private_template:
118   extends: .shared_template
119   tags:
120     - docker
121     - private
122   before_script:
123     - uname -a
124     - lsb_release -a
125     - mount
126     - df -h
127     - free -h
128   only:
129     variables:
130       # These jobs are only run if the gitlab repo has private runners available.
131       # To enable private jobs, you must add the following var and value to
132       # your gitlab repo by navigating to:
133       # settings -> CI/CD -> Environment variables
134       - $SUPPORT_PRIVATE_TEST == "yes"
135
136 samba:
137   extends: .private_template
138   # this one takes about 4 hours to finish
139
140 samba-fileserver:
141   extends: .private_template
142   # this one takes about 1 hours to finish
143
144 samba-ad-dc-1:
145   extends: .private_template
146
147 samba-nt4:
148   extends: .private_template