stages:
- check
+ - packaging
default:
image: registry.nic.cz/knot/knot-resolver-manager/knot-manager:ci
stage: check
script:
- poe integration
+
+
+package-debian:
+ when: manual
+ stage: packaging
+ image: registry.nic.cz/labs/lxc-gitlab-runner/debian-10
+ before_script: []
+ script:
+ - bash scripts/make-debian-package.sh
+ artifacts:
+ paths:
+ - pkg/pkgs/debian-10/
+ - pkg/srcpkgs/debian-10
+ expire_in: 1 week
--- /dev/null
+#!/bin/bash
+
+export DEBIAN_FRONTEND=noninteractive
+
+# upgrade system to latest
+apt-get update -qqq
+apt-get upgrade -y -qqq
+
+# configure repository with Knot Resolver dependencies
+apt-get -y -qqq install apt-transport-https lsb-release ca-certificates wget curl gnupg2
+sh -c 'echo "deb http://download.opensuse.org/repositories/home:/CZ-NIC:/knot-resolver-build/Debian_10/ /" > /etc/apt/sources.list.d/home:CZ-NIC:knot-resolver-build.list'
+sh -c 'curl -fsSL https://download.opensuse.org/repositories/home:CZ-NIC:knot-resolver-build/Debian_10/Release.key | gpg --dearmor > /etc/apt/trusted.gpg.d/home_CZ-NIC_knot-resolver-build.gpg'
+apt-get update -qqq
+
+# apkg
+apt-get install -y python3-pip
+pip3 install apkg
+
+# git
+apt-get install -y git
+
+# prepare the repo
+git clone https://gitlab.nic.cz/knot/knot-resolver
+cd knot-resolver
+git checkout manager-pkg
+git rebase origin/manager-integration
+git submodule update --init --recursive
+
+# build the package
+apkg system-setup
+apkg build -b
+
+
+
+
+
+++ /dev/null
-#!/bin/bash
-
-# ensure consistent behaviour
-src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
-
-
-# Debian 10 packaging
-if [[ -f "/etc/debian_version" && "$(cat /etc/debian_version)" == 10.* ]] ; then
- # if running on debian 10, just run the packaging process
-
- # if possible, make sure we use the latest apkg
- if [[ "$(id -u)" == "0" ]]; then
- python3 -m pip install -U apkg
- apt update
- fi
-
- apkg build -i
-elif [[ "${container:-}" != "podman" ]]; then
- # if not running debian 10 and not running inside a container, launch a build container and try again
- poe container run -c --artifact /code/pkg/pkgs/debian-10:pkg/pkgs/debian-10 --artifact /code/pkg/srcpkgs/debian-10:pkg/srcpkgs/debian-10 -- debian10 scripts/package
-else
- echo -e "${red}Debian 10 package creation skipped...${reset}"
-fi
\ No newline at end of file