- echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
- diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
- diff -u bootstrap/sha1sum.txt /sha1sum.txt
+ - echo "${CI_COMMIT_SHA} ${CI_COMMIT_TITLE}" > /tmp/commit.txt
- export CCACHE_BASEDIR="${PWD}"
- export CCACHE_DIR="${PWD}/ccache" && mkdir -pv "$CCACHE_DIR"
- export CC="ccache cc"
- script/autobuild.py samba-xc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/samba-xc
- script/autobuild.py docs-xml $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/docs-xml
+.shared_template_build_only:
+ extends: .shared_template
+ stage: build_first
+ artifacts:
+ expire_in: 1 week
+ paths:
+ - "*.stdout"
+ - "*.stderr"
+ - "*.info"
+ - system-info.txt
+ - samba-testbase.tar.gz
+ script:
+ # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
+ # autobuild name, which means we can define a default template that runs most autobuild jobs
+ - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase
+ # On success we need to pack everything into an artifacts file
+ # which needs to be in the git checkout.
+ # As tar doesn't handle hardlink of read-only files,
+ # we remember the acls and add write permissions
+ # before creating the archive. The consumer will apply
+ # the acls again.
+ - cp -a /sha1sum.txt /tmp/samba-testbase/image-sha1sum.txt
+ - cp -a /tmp/commit.txt /tmp/samba-testbase/commit.txt
+ - pushd /tmp && getfacl -R samba-testbase > samba-testbase.acl.dump && popd
+ - chmod -R +w /tmp/samba-testbase
+ - mv /tmp/samba-testbase.acl.dump /tmp/samba-testbase/
+ - tar cfz samba-testbase.tar.gz /tmp/samba-testbase
+ - ls -la samba-testbase.tar.gz
+ - sha1sum samba-testbase.tar.gz
+
+.shared_template_test_only:
+ extends: .shared_template
+ stage: build
+ script:
+ # We unpack the artifacts file created by the .shared_template_build_only
+ # run we depend on
+ - ls -la samba-testbase.tar.gz
+ - sha1sum samba-testbase.tar.gz
+ - tar xfz samba-testbase.tar.gz -C /
+ - diff -u /tmp/samba-testbase/image-sha1sum.txt /sha1sum.txt
+ - diff -u /tmp/samba-testbase/commit.txt /tmp/commit.txt
+ - mv /tmp/samba-testbase/samba-testbase.acl.dump /tmp/samba-testbase.acl.dump
+ - pushd /tmp && setfacl --restore=/tmp/samba-testbase.acl.dump && popd
+ # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
+ # autobuild name, which means we can define a default template that runs most autobuild jobs
+ - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --skip-dependencies --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase
+
+samba-def-build:
+ extends: .shared_template_build_only
+
+.needs_samba-def-build:
+ extends: .shared_template_test_only
+ needs:
+ - job: samba-def-build
+ artifacts: true
+
+samba-mit-build:
+ extends: .shared_template_build_only
+
+.needs_samba-mit-build:
+ extends: .shared_template_test_only
+ needs:
+ - job: samba-mit-build
+ artifacts: true
+
samba:
extends: .shared_template
extends: .shared_template
samba-admem:
- extends: .shared_template
+ extends: .needs_samba-def-build
samba-ad-dc-2:
- extends: .shared_template
+ extends: .needs_samba-def-build
samba-ad-dc-3:
- extends: .shared_template
+ extends: .needs_samba-def-build
samba-ad-dc-4:
- extends: .shared_template
+ extends: .needs_samba-def-build
samba-ad-dc-5:
- extends: .shared_template
+ extends: .needs_samba-def-build
samba-ad-dc-6:
- extends: .shared_template
+ extends: .needs_samba-def-build
samba-libs:
extends: .shared_template
extends: .shared_template
samba-ad-dc-ntvfs:
- extends: .shared_template
+ extends: .needs_samba-def-build
samba-admem-mit:
- extends: .shared_template
+ extends: .needs_samba-mit-build
samba-ad-dc-4-mitkrb5:
- extends: .shared_template
+ extends: .needs_samba-mit-build
# This task is run first to ensure we compile before we start the
# main run as it is the fastest full compile of Samba.
samba-fips:
- stage: build_first
extends: .shared_template
image: $SAMBA_CI_CONTAINER_IMAGE_fedora33