]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
scripts: utility script for OBS test build
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 13 Aug 2018 15:03:36 +0000 (17:03 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Fri, 17 Aug 2018 16:25:53 +0000 (16:25 +0000)
scripts/build-in-obs.sh
scripts/obs-testbuild.sh [new file with mode: 0755]

index 51d55420759c050f3c1c68034d6d1c32d7df1636..976d33664e470c190e65a5126097f6852ad390f0 100755 (executable)
@@ -8,7 +8,7 @@
 project=home:CZ-NIC:$1
 package=knot-resolver
 
-if ! [[ "$1" == *-devel ]]; then
+if ! [[ "$1" == *-devel || "$1" == *-testing ]]; then
        read -p "Pushing to '$project', are you sure? [y/N]: " yn
        case $yn in
                [Yy]* ) break;;
diff --git a/scripts/obs-testbuild.sh b/scripts/obs-testbuild.sh
new file mode 100755 (executable)
index 0000000..f44cecc
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# Builds the checked out version in knot-dns-testing OBS repository
+
+set -o errexit -o nounset -o xtrace
+
+force=false
+
+# Read options
+while getopts "f" o; do
+    case "${o}" in
+        f)
+            force=true
+            ;;
+        *)
+            ;;
+    esac
+done
+shift $((OPTIND-1))
+
+# Clean working tree
+if [[ $(git status --porcelain | wc -l) -ne 0 ]]; then
+    if [ "$force" = false ]; then
+        echo "working tree dirty. force clean with '-f'"
+        exit 1
+    fi
+    git clean -dfx
+    git reset --hard
+fi
+
+# Create tarball
+scripts/make-archive.sh
+
+# Submit to OBS
+scripts/make-distrofiles.sh -s
+scripts/build-in-obs.sh knot-resolver-testing
+
+echo "Check results at https://build.opensuse.org/package/show/home:CZ-NIC:knot-resolver-testing/knot-resolver"