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
This commit is contained in:
36
logerrit
36
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 $@
|
||||
;;
|
||||
|
Reference in New Issue
Block a user