diff --git a/debian/.gitlab-ci.yml b/debian/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..9150f20cbae2a838185e872dd76f56cf9725ecf6 --- /dev/null +++ b/debian/.gitlab-ci.yml @@ -0,0 +1,84 @@ +variables: + DEBFULLNAME: "Salsa Pipeline" + DEBEMAIL: "" + DEBIAN_FRONTEND: noninteractive + WORKING_DIR: ./debian/output + DEB_BUILD_OPTIONS: "nocheck noautodbgsym" + RELEASE: unstable + +stages: + - build + - test + +build package: + stage: build + image: registry.salsa.debian.org/salsa-ci-team/images/gbp + services: + - docker:dind + artifacts: + expire_in: 180 day + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/ + script: + - gbp pull --ignore-branch --pristine-tar --track-missing + - while true; do sleep 600; echo "10 minutes passed" >&2; done & # Progress keeper since build is long and silent + - gbp buildpackage --git-ignore-branch --git-export-dir=${WORKING_DIR} -us -uc --git-builder="docker-build.sh registry.salsa.debian.org/salsa-ci-team/images/base:${RELEASE}" | tail -n 10000 # Keep log under 4 MB + - du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB. + +# Autopkgtest must be disabled, because the test 'upstream' will be skipped and +# thus the command returns exit code 2 and is considered failed by Gitlab CI. +# Removing 'breaks-testbed' stanza from tests/control will result in that the +# test is run on Gitlab CI, but then it will fail in multiple tests as it cannot +# bind to network interfaces and other needes stuff inside Gitlab CI containers. +# +#run autopkgtest: +# stage: test +# script: +# - apt-get update && apt-get install autopkgtest eatmydata -y --no-install-recommends +# - eatmydata autopkgtest ${WORKING_DIR}/*.deb -- null + +run lintian: + stage: test + image: registry.salsa.debian.org/salsa-ci-team/images/lintian + script: + - apt-get update + - apt-get install -y dpkg-dev + - lintian -iI ${WORKING_DIR}/*.changes + +# Reprotest exceeds the 2 hour timeout limit on Github CI, so results in failure +# and must be disabled until a quicker (times two) build is possible. +#run reprotest: +# stage: test +# image: genericpipeline/reprotest-docker +# artifacts: +# name: "$CI_BUILD_NAME" +# expire_in: 180 day +# paths: +# - ./reprotest.log +# when: always +# script: +# - apt-get update && apt-get install eatmydata -y +# - eatmydata apt-get build-dep -y . +# - export DEB_BUILD_OPTIONS=nocheck +# - eatmydata reprotest . -- null &> reprotest.log +# tags: +# - privileged + +# Piuparts is passing on official piuparts.debian.org, but fail on Gitlab CI +# with 'FAIL: Package purging left files on system'. Disabling for now. +#run piuparts: +# stage: test +# image: genericpipeline/piuparts-docker +# services: +# - docker:dind +# script: +# - CHROOT_PATH=/tmp/debian-unstable +# - CONTAINER_ID=$(docker run --rm -d debian:unstable sleep infinity) +# - docker exec ${CONTAINER_ID} bash -c "apt-get update && apt-get install eatmydata -y" +# - mkdir -p ${CHROOT_PATH} +# - docker export ${CONTAINER_ID} | tar -C ${CHROOT_PATH} -xf - +# - mknod -m 666 ${CHROOT_PATH}/dev/urandom c 1 9 +# - piuparts --hard-link -e ${CHROOT_PATH} ${WORKING_DIR}/*.deb +# tags: +# - privileged diff --git a/debian/tests/smoke b/debian/tests/smoke index d463b168ac4011d94f869a03cee4ef0f215c399e..43e3a4ca3754b72f7e2502c38e42ca00892565f5 100644 --- a/debian/tests/smoke +++ b/debian/tests/smoke @@ -21,6 +21,22 @@ set -ex # 2) Creates a test table and checks it appears to operate normally # using the test user and test database. +# Start the deamon if it was not running. For example in Docker testing +# environments there might not be any systemd et al and the service needs to +# be started manually. +if ! which systemctl +then + if ! /etc/init.d/mysql status + then + echo "Did not find systemctl and deamon was not running, starting it.." + /etc/init.d/mysql start + fi +else + # If systemd (and systemctl) is available, but the service did not start, then + # this smoke test is supposed to fail if next commands don't work. + echo "Found systemctl, continuing smoke test.." +fi + mysql <