diff options
author | ivaradi <ivaradi@users.noreply.github.com> | 2017-05-04 07:35:08 +0300 |
---|---|---|
committer | Daniel Hansson <daniel@techandme.se> | 2017-05-04 07:35:08 +0300 |
commit | 52f5289919de9e2332e990bd39fc99b4bcdc1d7a (patch) | |
tree | 47e0f8ab1a6b61176784d5b165c42159699df6ce /linux | |
parent | d5c8424b4655c72e16929739c7f7268163480a16 (diff) |
Travis build of Ubuntu packages (#133)
Diffstat (limited to 'linux')
-rwxr-xr-x | linux/debian/scripts/git2changelog.py | 62 | ||||
-rw-r--r-- | linux/debian/signing-key.txt.enc | bin | 0 -> 6672 bytes | |||
-rwxr-xr-x | linux/debian/travis-build.sh | 63 | ||||
-rwxr-xr-x | linux/travis-build.sh | 2 |
4 files changed, 127 insertions, 0 deletions
diff --git a/linux/debian/scripts/git2changelog.py b/linux/debian/scripts/git2changelog.py new file mode 100755 index 0000000..d1d36f2 --- /dev/null +++ b/linux/debian/scripts/git2changelog.py @@ -0,0 +1,62 @@ +#!//usr/bin/env python2.7 + +import subprocess +import re +import sys + +baseVersion="2.2.4" +distribution="yakkety" + +versionTagRE = re.compile("^v([0-9]+((\.[0-9]+)+))(-(.+))?$") + +def collectEntries(baseCommit, baseVersion): + entries = [] + + args = ["git", "log", + "--format=%h%x09%an%x09%ae%x09%aD%x09%ad%x09%s", + "--date=format:%Y%m%d.%H%M%S", + "--author-date-order", "--reverse"] + try: + output = subprocess.check_output(args + [baseCommit + ".."]) + except: + output = subprocess.check_output(args) + + for line in output.splitlines(): + (commit, name, email, date, revdate, subject) = line.split("\t") + + for tag in subprocess.check_output(["git", "tag", + "--points-at", + commit]).splitlines(): + m = versionTagRE.match(tag) + if m: + baseVersion = m.group(1) + + entries.append((commit, name, email, date, revdate, subject, + baseVersion)) + + entries.reverse() + + return entries + +def genChangeLogEntries(f, entries, distribution): + for (commit, name, email, date, revdate, subject, baseVersion) in entries: + upstreamVersion = baseVersion + "-" + revdate + version = upstreamVersion + "~" + distribution + "1" + print >> f, "nextcloud-client (%s) %s; urgency=medium" % (version, distribution) + print >> f + print >> f, " * " + subject + print >> f + print >> f, " -- %s <%s> %s" % (name, email, date) + print >> f + return baseVersion + +if __name__ == "__main__": + distribution = sys.argv[2] + + #entries = collectEntries("8aade24147b5313f8241a8b42331442b7f40eef9", "2.2.4") + entries = collectEntries("dcac71898e7fda7ae4b149e2db25c178c90e7172", "2.3.1") + + + with open(sys.argv[1], "wt") as f: + baseVersion = genChangeLogEntries(f, entries, distribution) + print baseVersion diff --git a/linux/debian/signing-key.txt.enc b/linux/debian/signing-key.txt.enc Binary files differnew file mode 100644 index 0000000..ef62fa1 --- /dev/null +++ b/linux/debian/signing-key.txt.enc diff --git a/linux/debian/travis-build.sh b/linux/debian/travis-build.sh new file mode 100755 index 0000000..6ec91cb --- /dev/null +++ b/linux/debian/travis-build.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +set -xe + +TRAVIS_BUILD_STEP="$1" + +if [ "$TRAVIS_BUILD_STEP" == "install" ]; then + sudo apt-get update -q + sudo apt-get install -y devscripts cdbs + + openssl aes-256-cbc -K $encrypted_585e03da75ed_key -iv $encrypted_585e03da75ed_iv -in linux/debian/signing-key.txt.enc -d | gpg --import + echo "DEBUILD_DPKG_BUILDPACKAGE_OPTS='-k7D14AA7B'" >> ~/.devscripts + +elif [ "$TRAVIS_BUILD_STEP" == "script" ]; then + #pwd + #ls -al + #git log + basever=`linux/debian/scripts/git2changelog.py /tmp/tmpchangelog stable` + + cd .. + origsourceopt="" + #if ! wget http://ppa.launchpad.net/ivaradi/nextcloud-client-exp/ubuntu/pool/main/n/nextcloud-client/nextcloud-client_${basever}.orig.tar.bz2; then + if ! wget http://ppa.launchpad.net/nextcloud-devs/client/ubuntu/pool/main/n/nextcloud-client/nextcloud-client_${basever}.orig.tar.bz2; then + mv client_theming nextcloud-client_${basever} + tar cjf nextcloud-client_${basever}.orig.tar.bz2 --exclude .git nextcloud-client_${basever} + mv nextcloud-client_${basever} client_theming + origsourceopt="-sa" + fi + + for distribution in trusty xenial yakkety zesty; do + rm -rf nextcloud-client_${basever} + cp -a client_theming nextcloud-client_${basever} + + cd nextcloud-client_${basever} + + cp -a linux/debian/nextcloud-client/debian . + if test -d linux/debian/nextcloud-client/debian.${distribution}; then + cp -a linux/debian/nextcloud-client/debian.${distribution} debian + fi + + linux/debian/scripts/git2changelog.py /tmp/tmpchangelog ${distribution} + cp /tmp/tmpchangelog debian/changelog + if test -f linux/debian/nextcloud-client/debian.${distribution}/changelog; then + cat linux/debian/nextcloud-client/debian.${distribution}/changelog >> debian/changelog + else + cat linux/debian/nextcloud-client/debian/changelog >> debian/changelog + fi + + EDITOR=true dpkg-source --commit . local-changes + + debuild -S ${origsourceopt} + + cd .. + done + +elif [ "$TRAVIS_BUILD_STEP" == "snap_store_deploy" ]; then + cd .. + + for changes in nextcloud-client*_source.changes; do + #dput ppa:ivaradi/nextcloud-client-exp $changes > /dev/null + dput ppa:nextcloud-devs/client $changes > /dev/null + done +fi diff --git a/linux/travis-build.sh b/linux/travis-build.sh index 22eb7ea..9da9f70 100755 --- a/linux/travis-build.sh +++ b/linux/travis-build.sh @@ -81,6 +81,8 @@ elif [ "$BUILD_TYPE" == "snap" ]; then snap=$(ls $THIS_PATH/*.snap -1 | head -n1) curl --progress-bar --upload-file "$snap" "https://transfer.sh/$(basename $snap)" fi +elif [ "$BUILD_TYPE" == "debian" ]; then + linux/debian/travis-build.sh "$@" else echo 'No $BUILD_TYPE defined' exit 1 |