s3:winbindd: Replace E_md5hash() with GnuTLS calls
[Samba.git] / bootstrap / .gitlab-ci.yml
blob865d93485a88bd164782199d0b4df636698c2544
1 services:
2   - docker:dind
4 .build_image_template:
5   image: docker:latest
6   stage: images
7   tags:
8     - docker
9     - shared
10   variables:
11     SAMBA_CI_IS_BROKEN_IMAGE: "no"
12   before_script:
13     # Ensure we are generating correct the container
14     - uname -a
15     - cat /etc/os-release
16     - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
17     - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
18     - echo "SAMBA_CI_IS_BROKEN_IMAGE[${SAMBA_CI_IS_BROKEN_IMAGE}]"
19     - echo "SAMBA_CI_REBUILD_IMAGES[${SAMBA_CI_REBUILD_IMAGES}]"
20     - echo "SAMBA_CI_REBUILD_BROKEN_IMAGES[${SAMBA_CI_REBUILD_BROKEN_IMAGES}]"
21     - echo "GITLAB_USER_LOGIN[${GITLAB_USER_LOGIN}]"
22     - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
23     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
24   script: |
25     set -xueo pipefail
26     ci_image_name=samba-ci-${CI_JOB_NAME}
27     docker build -t ${ci_image_name} --build-arg SHA1SUM=${SAMBA_CI_CONTAINER_TAG} bootstrap/generated-dists/${CI_JOB_NAME}
28     ci_image_path="${SAMBA_CI_CONTAINER_REGISTRY}/${ci_image_name}"
29     timestamp=$(date +%Y%m%d%H%M%S)
30     docker_hash=$(docker image inspect --format='{{index .Id}}' ${ci_image_name} | cut -d : -f 2 | cut -c 1-9)
31     timestamp_tag=${SAMBA_CI_CONTAINER_TAG}-${timestamp}-${GITLAB_USER_LOGIN}-${docker_hash}
32     samba_repo_root=/home/samba/samba
33     # Ensure we are generating the correct container that we expect to be in
34     echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
35     diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
36     docker run --volume $(pwd):${samba_repo_root} --workdir ${samba_repo_root} ${ci_image_name} \
37         /bin/bash -c "echo \"${SAMBA_CI_CONTAINER_TAG}\" > /tmp/sha1sum-tag.txt; diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt"
38     docker run --volume $(pwd):${samba_repo_root} --workdir ${samba_repo_root} ${ci_image_name} \
39         diff -u bootstrap/sha1sum.txt /sha1sum.txt
40     docker run --volume $(pwd):${samba_repo_root} --workdir ${samba_repo_root} ${ci_image_name} \
41         bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
42     diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
43     # run smoke test with samba-o3
44     docker run --volume $(pwd):${samba_repo_root} --workdir ${samba_repo_root} ${ci_image_name} \
45         /bin/bash -c "sudo chown -R samba:samba ./** && export PKG_CONFIG_PATH=/usr/lib64/compat-gnutls34/pkgconfig:/usr/lib64/compat-nettle32/pkgconfig && script/autobuild.py samba-o3 --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
46     docker tag ${ci_image_name} ${ci_image_path}:${SAMBA_CI_CONTAINER_TAG}
47     docker tag ${ci_image_name} ${ci_image_path}:${timestamp_tag}
48     # We build all images, but only upload is it's not marked as broken
49     test x"${SAMBA_CI_IS_BROKEN_IMAGE}" = x"yes" || { \
50         docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY; \
51         docker push ${ci_image_path}:${SAMBA_CI_CONTAINER_TAG}; \
52         docker push ${ci_image_path}:${timestamp_tag}; \
53     }
54     echo "Success for ${ci_image_path}:${timestamp_tag}"
55     test x"${SAMBA_CI_IS_BROKEN_IMAGE}" = x"no" || { \
56          echo "The image ${CI_JOB_NAME} is marked as broken and should have failed!"; \
57          echo "Replace .build_image_template_force_broken with .build_image_template!"; \
58          echo "Add a .samba-o3-template section at the end of the main .gitlab-ci.yml!"; \
59          /bin/false; \
60     }
61   only:
62     variables:
63       #
64       # You need a custom pipeline which passes
65       # SAMBA_CI_REBUILD_IMAGES="yes".
66       #
67       # https://gitlab.com/samba-team/devel/samba/pipelines/new
68       #
69       - $SAMBA_CI_REBUILD_IMAGES == "yes"
71 .build_image_template_force_broken:
72   extends: .build_image_template
73   variables:
74     SAMBA_CI_IS_BROKEN_IMAGE: "yes"
75   only:
76     variables:
77       #
78       # You need a custom pipeline which passes
79       # SAMBA_CI_REBUILD_BROKEN_IMAGES="yes"
80       # in order to build broken images for debugging
81       #
82       # https://gitlab.com/samba-team/devel/samba/pipelines/new
83       #
84       - $SAMBA_CI_REBUILD_BROKEN_IMAGES == "yes"
86 ubuntu1804:
87   extends: .build_image_template
89 ubuntu1604:
90   extends: .build_image_template
92 ubuntu1404:
93   extends: .build_image_template_force_broken
95 debian9:
96   extends: .build_image_template
98 debian8:
99   extends: .build_image_template_force_broken
101 debian7:
102   extends: .build_image_template_force_broken
104 fedora31:
105   extends: .build_image_template
107 fedora30:
108   extends: .build_image_template
110 fedora29:
111   extends: .build_image_template
113 centos8:
114   extends: .build_image_template
116 centos7:
117   extends: .build_image_template
118   variables:
119     # Shallow copies are not supported by git on CentOS7
120     GIT_DEPTH: ""
121     # We install a compat-gnutls34 package for GnuTLS >= 3.4.7
122     PKG_CONFIG_PATH: /usr/lib64/compat-gnutls34/pkgconfig:/usr/lib64/compat-nettle32/pkgconfig
124 centos6:
125   extends: .build_image_template_force_broken
127 opensuse150:
128   extends: .build_image_template
130 opensuse151:
131   extends: .build_image_template