Commit a9d7a34a authored by Vitaly Lipatov's avatar Vitaly Lipatov

gitask: add get subtask command, use it in rpmbs

parent 93bba62c
......@@ -20,6 +20,20 @@ fi
# TODO: acl
if [ "$1" = "get" ] ; then
if [ "$1 $2" = "get subtask" ] ; then
[ -n "$3" ] || fatal "get subtask TASK PROJECTNMAE"
# get subtask number from TASKNUMBER for PROJECTNAME
SUBTASK="$(GIT_ALT=$GEARHOST girar-show $3@ | grep "/$4.git" | sed -e "s|.*#\([0-9]*\) .*|\1|g")" || fatal
#"
echo "$SUBTASK"
exit
else
fatal "Unknown command $1 $2"
fi
fi
if [ "$1" = "find" ] ; then
shift
#showcmd "$GEARHOST>" find-packages "$@"
......
......@@ -311,11 +311,11 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
echo "Run build $PROJECTNAME at $GEARHOST"
# FIXME: tee hangup during first call with ssh ControlMaster
if [ -n "$PREPARETASK" ] ; then
showcmd "GIT_ALT=$GEARHOST girar-show $TASKNUMBER@"
SUBTASK="$(GIT_ALT=$GEARHOST girar-show $TASKNUMBER@ | grep "/$PROJECTNAME.git" | sed -e "s|.*#\([0-9]*\) .*|\1|g")"
# hack "
# TODO: can we use showcmd?
showcmd $ETERBUILDBIN/gita get subtask $TASKNUMBER $PROJECTNAME
SUBTASK=$($ETERBUILDBIN/gita get subtask $TASKNUMBER $PROJECTNAME)
if [ -n "$SUBTASK" ] && ! echo "$TASKNUMBER" | grep -q " " ; then
info "$PROJECTNAME already in task as subtask $SUBTASK, replacing"
info "$PROJECTNAME already present in the task $TASKNUMBER as subtask $SUBTASK, replacing"
docmd ssh $GEARHOST task delsub $TASKNUMBER $SUBTASK
TASKNUMBER="$TASKNUMBER $SUBTASK"
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