summaryrefslogtreecommitdiff
path: root/logerrit
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-06-10 17:51:29 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-06-10 18:05:34 +0200
commitef4fd9c52f16e6d242f999dd87170e6cac07230d (patch)
tree6e4c2868452749441943ab12003ffd4e342585dd /logerrit
parentbee2423eff85ebc5f0255596bcf7bec2596307a9 (diff)
add ./logerrit testfeature
- ./logerrit testfeature will trigger a testbuild of the current feature branch as it is on gerrit - ./logerrit testfeature $BRANCH will do the same for $BRANCH - cloning to a tempdir and rm -rf'ing around isnt ideal, so consider this as a template for your own scripting Change-Id: I50a3c80748af82d855522f245ddbff227c8adab2
Diffstat (limited to 'logerrit')
-rwxr-xr-xlogerrit36
1 files changed, 36 insertions, 0 deletions
diff --git a/logerrit b/logerrit
index 9e7f2b87fd1e..a88c56f383d7 100755
--- a/logerrit
+++ b/logerrit
@@ -52,6 +52,7 @@ case "$1" in
echo " (yes, this modifies your last commit)"
echo " (yes, this modifies your last commit)"
echo " nextchange [BRANCH] reset branch to the remote to start with the next change"
+ echo " testfeature [BRANCH] trigger a test of a feature branch on gerrit"
echo "Note: drafts are only visibly to yourself and those that you explicitly add as reviewers."
echo
echo " --- for reviewers:"
@@ -203,6 +204,41 @@ case "$1" in
shift
ssh ${GERRITHOST?} gerrit query project:core $@
;;
+ testfeature)
+ BRANCH=$2
+ if test -z "$BRANCH"
+ then
+ BRANCH=`git symbolic-ref HEAD 2> /dev/null`
+ BRANCH="${BRANCH##refs/heads/}"
+ if test -z "$BRANCH"
+ then
+ echo "no branch specified, and could not guess the current branch"
+ exit 1
+ fi
+ echo "no branch specified, guessing current branch $BRANCH"
+ fi
+ BRANCH="${BRANCH##feature/}"
+ WORKDIR=`mktemp -d`
+ if test -z "$WORKDIR"
+ then
+ echo "could no create work directory."
+ exit 1
+ fi
+ echo workdir at $WORKDIR
+ git clone -s `dirname $0` $WORKDIR/core
+ pushd $WORKDIR/core
+ echo "noop commit: trigger test build for branch feature/$BRANCH" > ../commitmsg
+ echo >> ../commitmsg
+ echo "branch is at:" >> ../commitmsg
+ git log -1|sed -e "s/Change-Id:/XXXXXX:/" >> ../commitmsg
+ git fetch git://gerrit.libreoffice.org/core.git feature/$BRANCH && \
+ git checkout -b featuretst FETCH_HEAD && \
+ cp -a .git-hooks/* .git/hooks
+ git commit --allow-empty -F ../commitmsg && \
+ git push $GERRITURL HEAD:refs/for/feature/$BRANCH
+ popd
+ rm -rf $WORKDIR/core
+ ;;
*)
ssh ${GERRITHOST?} gerrit $@
;;