Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

Commit

Permalink
Building scripts
Browse files Browse the repository at this point in the history
+ added scripts for triggering build system:
  * build.sh creates changelog entry, commit and tag. Can also push
    everything to origin
  * push.sh pushes specified version to origin
  * unbuild.sh resets changes done by build.sh
+ if you want scripts to be fully automated set DEBFULLNAME and
  DEBEMAIL system variables. Otherwise changelog could be invalid.
  • Loading branch information
jkotur committed Apr 16, 2012
1 parent bcc879a commit 4f2eb13
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 0 deletions.
75 changes: 75 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash

fail() {

echo
echo " FATAL ERROR - building terminated "
echo
exit $1
}

do_build() {
dist=$1
ver=$2
echo
echo " ====== Building: $dist $ver ====== "
echo
dch -v $ver -D $dist --force-distribution building $dist || fail $?
git add debian/changelog
git commit -m "building $dist" || fail $?
git tag $ver || fail $?
}

do_push() {
git push || fail $?
git push origin $ver || fail $?
}

do_usage() {
echo "Usage:"
echo " $0 [-p] <distribution> <version>"
echo
echo -e " -p\tpush to origin"
echo
echo " distribution 'all' will create tags for all distributions"
exit 0
}

push=0

if [ $# -eq 3 ]
then
if [ $1 == '-p' ]
then
push=1
shift
else
do_usage
fi
elif [ $# -ne 2 ]
then
do_usage
fi

dists=$1

if [ $dists = "all" ]
then
dists="lenny squeeze unstable natty oneiric"
fi

version=$2

for d in $dists
do
do_build $d $version
if [ $push -eq 1 ]
then
do_push $d $version
fi

suffix=${version##*.}
let "suffix += 1"
version=${version%.*}.$suffix
done

22 changes: 22 additions & 0 deletions push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

fail() {

echo
echo " FATAL ERROR - pushing terminated "
echo
exit $1
}

if [ $# -ne 2 ]
then
echo "Usage:"
echo " $0 <version>"
exit 0
fi

ver=$2

git push || fail $?
git push origin $ver || fail $?

23 changes: 23 additions & 0 deletions unbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

fail() {

echo
echo " FATAL ERROR - unbuildin terminated "
echo
exit $1
}

if [ $# -ne 1 ]
then
echo "Usage:"
echo " $0 <version>"
exit 0
fi

ver=$1

git reset $ver~1 || fail $?
git checkout debian/changelog || fail $?
git tag -d $ver || fail $?

0 comments on commit 4f2eb13

Please sign in to comment.