From 456290ca196b76007513257b493aff27762e9d0b Mon Sep 17 00:00:00 2001 From: anon8675309 Date: Sun, 23 May 2021 01:45:07 -0500 Subject: [PATCH] Enable gitlab CI to build debian packages --- .gitlab-ci.yml | 17 +++++++++++++++++ utils/do_debian_package.sh | 18 +++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..95eb8f483 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,17 @@ +default: + image: + name: ubuntu:latest + before_script: + - apt-get update -yq + - DEBIAN_FRONTEND=noninteractive apt-get install -yq devscripts sudo + +deb: + stage: build + tags: + - docker + script: + - yes "" | ./utils/do_debian_package.sh --snapshot=stable --branch=1.36.1 --type=binary --interactive=no --dput=no --debbuild-extra=--no-sign || true + artifacts: + paths: + - '*.deb' + expire_in: 1 week diff --git a/utils/do_debian_package.sh b/utils/do_debian_package.sh index 2b1d05832..7f29cf926 100755 --- a/utils/do_debian_package.sh +++ b/utils/do_debian_package.sh @@ -58,6 +58,14 @@ case $i in PACKAGE_VERSION="${i#*=}" shift ;; + -x=*|--debbuild-extra=*) + DEBBUILD_EXTRA="${i#*=}" + shift + ;; + --dput=*) + DPUT="${i#*=}" + shift + ;; --default) DEFAULT=YES shift # past argument with no value @@ -312,9 +320,11 @@ EOF if [ "$DEBSIGN_KEYID" != "" ]; then DEBUILD="$DEBUILD -k$DEBSIGN_KEYID" fi + # Add any extra options specified on the CLI + DEBUILD="$DEBUILD $DEBBUILD_EXTRA" eval $DEBUILD if [ $? -ne 0 ]; then - echo "Error status code is: $?" + echo "Error status code is: $?" echo "Build failed."; exit $?; fi; @@ -350,8 +360,10 @@ EOF dput $PPA $SC fi; else - echo "dputting to $PPA"; - dput $PPA $SC + if [ "$DPUT" != "no" ]; then + echo "dputting to $PPA"; + dput $PPA $SC + fi; fi; fi; done; # foreach distro