From a8cff58ba0fa50650f49ea55c6d1f4c3c7bc9a2d Mon Sep 17 00:00:00 2001 From: morph027 Date: Sat, 20 Jun 2020 10:55:39 +0200 Subject: [PATCH] add test for package --- .gitlab-ci.yml | 20 ++++++++++++++++++++ .gitlab-ci/test.sh | 11 +++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .gitlab-ci/test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25af76f..7858eca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - package + - test - repo - pages @@ -46,6 +47,25 @@ package: only: - tags +test-plain-install: + stage: test + image: docker:latest + services: + - docker:dind + script: + - docker run + -d + --name systemd-ubuntu + --privileged + -v /sys/fs/cgroup:/sys/fs/cgroup:ro + -v $CI_PROJECT_DIR:/src + -e CI_PROJECT_DIR=/src + -e CI_COMMIT_TAG=CI_COMMIT_TAG + jrei/systemd-ubuntu:20.04 + - docker exec -t systemd-ubuntu /bin/bash /src/.gitlab-ci/test.sh + only: + - tags + reprepro: cache: untracked: true diff --git a/.gitlab-ci/test.sh b/.gitlab-ci/test.sh new file mode 100644 index 0000000..2c3a89e --- /dev/null +++ b/.gitlab-ci/test.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +VERSION=$(echo "${CI_COMMIT_TAG#*v}" | cut -d'-' -f1) +PATCHLEVEL=$(echo "${CI_COMMIT_TAG}" | cut -d'-' -f2) +apt-get -qq update +apt-get -qqy install "${CI_PROJECT_DIR}/gitea_${VERSION}-${PATCHLEVEL}_amd64.deb" +systemctl start gitea +sleep 10 +if ! systemctl is-active gitea; then + journalctl -lu gitea --no-pager +fi