]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
ci: debian packaging
authorVasek Sraier <git@vakabus.cz>
Thu, 28 Oct 2021 13:54:56 +0000 (15:54 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 8 Apr 2022 14:17:53 +0000 (16:17 +0200)
manager/.gitlab-ci.yml
manager/scripts/make-debian-package.sh [new file with mode: 0644]
manager/scripts/package [deleted file]

index ab7defbee36786991aad11d15816aad6428c3230..5a3bc249f62b5cc1f2b10b997109508dc7764609 100644 (file)
@@ -1,5 +1,6 @@
 stages:
   - check
+  - packaging
 
 default:
   image: registry.nic.cz/knot/knot-resolver-manager/knot-manager:ci
@@ -37,3 +38,17 @@ integration:
   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
diff --git a/manager/scripts/make-debian-package.sh b/manager/scripts/make-debian-package.sh
new file mode 100644 (file)
index 0000000..a755188
--- /dev/null
@@ -0,0 +1,36 @@
+#!/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
+
+
+
+
+
diff --git a/manager/scripts/package b/manager/scripts/package
deleted file mode 100644 (file)
index 39252f9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/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