Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
aegir_jenkins_scripts/jenkins-debian-build
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
73 lines (60 sloc)
1.91 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -e | |
| # This script is designed to automatically build Debian packages for Jenkins | |
| # | |
| # It is used in the two following jobs: | |
| # D_aegir-debian-official | |
| # D_aegir-debian-auto | |
| DOMAIN=`hostname -f` | |
| KEY="jenkins@$DOMAIN" | |
| usage() { | |
| cat <<EOF | |
| Usage: $0 [ -hvn -k <key> ] | |
| Build an automatic package with the provided key. | |
| -h: this help | |
| -v: show every command ran | |
| -n: simulate: build but do not upload the package | |
| -k <key>: sign the package with this key (default: $KEY) | |
| -u: upload the package (default: don't upload) | |
| EOF | |
| } | |
| upload=false | |
| official=false | |
| set -- `getopt hvnk:uo $*` | |
| for i; do | |
| case "$i" in | |
| -h) shift; usage;; | |
| -v) shift; set -x;; | |
| -n) shift; simulate='echo > ';; | |
| -k) shift; KEY=$1; shift;; | |
| -u) shift; upload=true;; | |
| -o) shift; official=true;; | |
| --) shift; break;; | |
| esac | |
| done | |
| # the upstream version: strip the 6.x and turn the appendix into | |
| # +N.foo where N is the number of commits since last tag and foo is | |
| # the hash | |
| upstream_version=$(git describe --tags origin/6.x-1.x | sed 's/6.x-//;s/-\([0-9]*\)-\([^-]*\)$/+\1.\2/') | |
| echo building aegir-${upstream_version} with key $KEY - build tag: ${BUILD_TAG} | |
| trap "rm -rf build-area" 0 | |
| if $official; then | |
| $simulate git-buildpackage -k${KEY} | |
| else | |
| $simulate dch -D unstable -v ${upstream_version} "automatic jenkins build ${BUILD_TAG}" | |
| $simulate git commit -m"dummy commit for jenkins ${BUILD_TAG} autobuild" debian/changelog | |
| $simulate git-buildpackage -k${KEY} | |
| fi | |
| if $upload; then | |
| echo uploading package to aegir repository | |
| $simulate dput -f aegir build-area/*.changes | |
| $simulate sleep 5 | |
| debfile=`ls build-area | grep deb | head -1` | |
| if [ -f "/srv/reprepro/pool/main/a/aegir-provision/$debfile" ]; then | |
| echo "debian file built: $debfile" | |
| else | |
| echo "can't find debian file $debfile" | |
| exit 1 | |
| fi | |
| fi | |
| $simulate rm -r build-area | |
| $simulate git checkout ${GIT_COMMIT} |