Commit 56a6bb68 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmbs: add -F option to run task after add

parent bab63447
...@@ -24,6 +24,7 @@ SIGN= ...@@ -24,6 +24,7 @@ SIGN=
SIGNTAG= SIGNTAG=
SETTAG= SETTAG=
FORCE= FORCE=
RUNTASK=
UPLOADNOW= UPLOADNOW=
CHECKONLY= CHECKONLY=
TESTONLY= TESTONLY=
...@@ -63,6 +64,7 @@ phelp() ...@@ -63,6 +64,7 @@ phelp()
echog " -e sign and run gear test only task girar build" echog " -e sign and run gear test only task girar build"
echog " -c only sign package(s) with checking" echog " -c only sign package(s) with checking"
echog " -f force operation (overwrite tag)" echog " -f force operation (overwrite tag)"
echog " -F force operation (overwrite tag) and run task after add"
echog " -s sign package(s) (and move it to dir ETERDESTSRPM if defined)" echog " -s sign package(s) (and move it to dir ETERDESTSRPM if defined)"
echog " -t set tag with sign" echog " -t set tag with sign"
echog " -T set tag" echog " -T set tag"
...@@ -72,7 +74,7 @@ phelp() ...@@ -72,7 +74,7 @@ phelp()
# echog " -d - remove package(s) from SRPMS and Incoming" # echog " -d - remove package(s) from SRPMS and Incoming"
} }
while getopts :hfstTcudenop:a:Ab:z opt; do while getopts :hfFstTcudenop:a:Ab:z opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
s) SIGN=1 ;; s) SIGN=1 ;;
...@@ -80,6 +82,7 @@ while getopts :hfstTcudenop:a:Ab:z opt; do ...@@ -80,6 +82,7 @@ while getopts :hfstTcudenop:a:Ab:z opt; do
T) SETTAG=1 ;; T) SETTAG=1 ;;
e) TESTONLY="--test-only" ; UPLOADNOW=1 ; SIGN=1 ;; e) TESTONLY="--test-only" ; UPLOADNOW=1 ; SIGN=1 ;;
f) FORCE="-f" ;; f) FORCE="-f" ;;
F) FORCE="-f" ; RUNTASK=1 ;;
# FIXME: handle SIGN separately # FIXME: handle SIGN separately
c) CHECKONLY=1 ; SIGN=1 ;; c) CHECKONLY=1 ; SIGN=1 ;;
u) UPLOADNOW=1 ; SIGN=1 ;; u) UPLOADNOW=1 ; SIGN=1 ;;
...@@ -319,6 +322,7 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then ...@@ -319,6 +322,7 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
# TODO: add check for repo (as in rpmgp) and run ginit if needed # TODO: add check for repo (as in rpmgp) and run ginit if needed
docmd gpush $GIRARHOST $FORCE || fatal "gpush failed. It is possible you need run '\$ ginit $GIRARHOST' to create remote repo." docmd gpush $GIRARHOST $FORCE || fatal "gpush failed. It is possible you need run '\$ ginit $GIRARHOST' to create remote repo."
echo echo
ATASKNUMBER="$TASKNUMBER"
echo "Run build $PROJECTNAME at $GEARHOST" echo "Run build $PROJECTNAME at $GEARHOST"
# FIXME: tee hangup during first call with ssh ControlMaster # FIXME: tee hangup during first call with ssh ControlMaster
if [ -n "$PREPARETASK" ] ; then if [ -n "$PREPARETASK" ] ; then
...@@ -329,9 +333,9 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then ...@@ -329,9 +333,9 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
info "$PROJECTNAME already present in the task $TASKNUMBER as subtask $SUBTASK, replacing" info "$PROJECTNAME already present in the task $TASKNUMBER as subtask $SUBTASK, replacing"
docmd ssh $GEARHOST task delsub $TASKNUMBER $SUBTASK docmd ssh $GEARHOST task delsub $TASKNUMBER $SUBTASK
# add task subtask - before subtask! (use next number?) # add task subtask - before subtask! (use next number?)
TASKNUMBER="$TASKNUMBER $SUBTASK" ATASKNUMBER="$TASKNUMBER $SUBTASK"
fi fi
docmd ssh $GEARHOST task add $TASKNUMBER repo $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp docmd ssh $GEARHOST task add $ATASKNUMBER repo $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp
else else
docmd ssh $GEARHOST build $TESTONLY $(usearg -b $BINARYREPO sisyphus) $(usearg -p $POCKET) $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp docmd ssh $GEARHOST build $TESTONLY $(usearg -b $BINARYREPO sisyphus) $(usearg -p $POCKET) $PROJECTNAME $TAG 2>&1 | tee $RPMDIR/uploaded.log.tmp
fi fi
...@@ -346,14 +350,12 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then ...@@ -346,14 +350,12 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
done done
if [ -n "$TASKNUMBER" ] ; then if [ -n "$TASKNUMBER" ] ; then
# TODO: separate TASKNUMBER and SUBTASKNUMBER showcmd "GIT_ALT=$GEARHOST girar-show $TASKNUMBER@"
RTASKNUMBER=$(echo "$TASKNUMBER" | sed -e "s| .*||g") GIT_ALT=$GEARHOST girar-show "$TASKNUMBER@"
showcmd "GIT_ALT=$GEARHOST girar-show $RTASKNUMBER@"
GIT_ALT=$GEARHOST girar-show "$RTASKNUMBER@"
fi fi
# if more then one spec, use common task # if more then one spec, use common task
if [ "$PREPARETASK" = "internal" ] ; then if [ "$PREPARETASK" = "internal" ] || [ -n "$RUNTASK" ] ; then
docmd ssh $GEARHOST task run $TESTONLY $TASKNUMBER docmd ssh $GEARHOST task run $TESTONLY $TASKNUMBER
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment