Merge pull request #3255 from anon8675309/gitlab-ci

Enable gitlab CI to build debian packages
This commit is contained in:
Isaac Connor 2021-05-25 13:08:58 -04:00 committed by GitHub
commit a266388898
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 3 deletions

17
.gitlab-ci.yml Normal file
View File

@ -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

View File

@ -58,6 +58,14 @@ case $i in
PACKAGE_VERSION="${i#*=}" PACKAGE_VERSION="${i#*=}"
shift shift
;; ;;
-x=*|--debbuild-extra=*)
DEBBUILD_EXTRA="${i#*=}"
shift
;;
--dput=*)
DPUT="${i#*=}"
shift
;;
--default) --default)
DEFAULT=YES DEFAULT=YES
shift # past argument with no value shift # past argument with no value
@ -306,9 +314,11 @@ EOF
if [ "$DEBSIGN_KEYID" != "" ]; then if [ "$DEBSIGN_KEYID" != "" ]; then
DEBUILD="$DEBUILD -k$DEBSIGN_KEYID" DEBUILD="$DEBUILD -k$DEBSIGN_KEYID"
fi fi
# Add any extra options specified on the CLI
DEBUILD="$DEBUILD $DEBBUILD_EXTRA"
eval $DEBUILD eval $DEBUILD
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error status code is: $?" echo "Error status code is: $?"
echo "Build failed."; echo "Build failed.";
exit $?; exit $?;
fi; fi;
@ -344,8 +354,10 @@ EOF
dput $PPA $SC dput $PPA $SC
fi; fi;
else else
echo "dputting to $PPA"; if [ "$DPUT" != "no" ]; then
dput $PPA $SC echo "dputting to $PPA";
dput $PPA $SC
fi;
fi; fi;
fi; fi;
done; # foreach distro done; # foreach distro