TODO: script/autobuild removes this... do we want to use --nocleanup??? .gitlab-ci...
[metze/samba/wip.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     - mount
23     - df -h
24     - cat /proc/swaps
25     - free -h
26     - sudo swapoff -va || echo "ignore swaoff -va failure[$?]"
27     - cat /proc/swaps
28     - free -h
29   after_script:
30     - uname -a
31     - lsb_release -a
32     - mount
33     - df -h
34     - cat /proc/swaps
35     - free -h
36   artifacts:
37     expire_in: 1 week
38     when: on_failure
39     paths:
40       - "*.stdout"
41       - "*.stderr"
42       - system-info.txt
43       - /tmp/samba-testbase/b*/*/*/bin/config.log
44   retry:
45     max: 2
46     when:
47       - runner_system_failure
48       - stuck_or_timeout_failure
49   script:
50     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
51     # autobuild name, which means we can define a default template that runs most autobuild jobs
52     - echo "Running cmd script/autobuild.py $CI_JOB_NAME --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
53     - script/autobuild.py $CI_JOB_NAME    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
54
55 others:
56   extends: .shared_template
57   script:
58     - script/autobuild.py ldb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
59     - script/autobuild.py pidl             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
60     - script/autobuild.py replace          --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
61     - script/autobuild.py talloc           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
62     - script/autobuild.py tdb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
63     - script/autobuild.py tevent           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
64
65 samba:
66   extends: .shared_template
67
68 samba-none-env:
69   extends: .shared_template
70   # this one takes about 1 hours to finish
71
72 samba-nopython:
73   extends: .shared_template
74
75 samba-nopython-py2:
76   extends: .shared_template
77
78 samba-systemkrb5:
79   extends: .shared_template
80
81 samba-xc:
82   extends: .shared_template
83
84 samba-o3:
85   extends: .shared_template
86
87 samba-ad-member:
88   extends: .shared_template
89
90 samba-ad-dc-2:
91   extends: .shared_template
92
93 samba-ad-dc-3:
94   extends: .shared_template
95
96 samba-ad-dc-4:
97   extends: .shared_template
98
99 samba-ad-dc-5:
100   extends: .shared_template
101
102 samba-ad-dc-6:
103   extends: .shared_template
104
105 samba-ad-dc-backup:
106   extends: .shared_template
107
108 samba-libs:
109   extends: .shared_template
110
111 samba-static:
112   extends: .shared_template
113
114 ctdb:
115   extends: .shared_template
116
117 samba-ctdb:
118   extends: .shared_template
119
120 samba-ad-dc-ntvfs:
121   extends: .shared_template
122   # this one takes about 100 mins to finish
123
124
125 .private_template:
126   extends: .shared_template
127   tags:
128     - docker
129     - private
130   only:
131     variables:
132       # These jobs are only run if the gitlab repo has private runners available.
133       # To enable private jobs, you must add the following var and value to
134       # your gitlab repo by navigating to:
135       # settings -> CI/CD -> Environment variables
136       - $SUPPORT_PRIVATE_TEST == "yes"
137
138 samba-fileserver:
139   extends: .private_template
140   # this one takes about 1 hours to finish
141
142 samba-ad-dc-1:
143   extends: .private_template
144
145 samba-nt4:
146   extends: .private_template