Commit 0564d0d7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gitask: add -m <message> support for run and commit commands

parent 153815ee
#!/bin/sh #!/bin/sh
# 2017, 2018, 2019 (c) Etersoft https://etersoft.ru # 2017, 2018, 2019, 2020 (c) Etersoft https://etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain # Public domain
...@@ -18,8 +18,8 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then ...@@ -18,8 +18,8 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo echo
echo "Examples:" echo "Examples:"
echo " new [p8] - create new task [on p8 branch, Sisyphus by default]" echo " new [p8] - create new task [on p8 branch, Sisyphus by default]"
echo " run [NNNN] - run task NNNN" echo " run [-m <message>] [NNNN] - run task NNNN"
echo " commit [NNNN] [NNNN2] - commit task(s) NNNN, [NNNN2]" echo " commit [-m <message>] [NNNN] [NNNN2] - commit task(s) NNNN, [NNNN2]"
echo " add del package [package2] - add package remove command" echo " add del package [package2] - add package remove command"
echo " add rebuild package [package2] - add package rebuild" echo " add rebuild package [package2] - add package rebuild"
echo " add --help - show task add help" echo " add --help - show task add help"
...@@ -170,12 +170,19 @@ fi ...@@ -170,12 +170,19 @@ fi
if [ "$1" = "commit" ] ; then if [ "$1" = "commit" ] ; then
shift shift
COMMIT='' COMMIT=''
MESSAGE=''
if [ "$1" = "-m" ] ; then
MESSAGE="$1 $2"
shift 2
fi
TASKLIST="$*" TASKLIST="$*"
if [ -z "$TASKLIST" ] ; then if [ -z "$TASKLIST" ] ; then
TASKLIST="$(get_last)" || fatal "Can't get last task" TASKLIST="$(get_last)" || fatal "Can't get last task"
fi fi
for TASK in $TASKLIST ; do for TASK in $TASKLIST ; do
docmd ssh $GEARHOST task run --commit "$TASK" docmd ssh $GEARHOST task run $MESSAGE --commit "$TASK"
done done
exit exit
fi fi
...@@ -197,10 +204,14 @@ if [ "$1" = "run" ] ; then ...@@ -197,10 +204,14 @@ if [ "$1" = "run" ] ; then
COMMIT='' COMMIT=''
PARAMTEST='' PARAMTEST=''
TASK='' TASK=''
MESSAGE=''
while [ -n "$1" ] ; do while [ -n "$1" ] ; do
if echo "$1" | grep -qv "^--" ; then if echo "$1" | grep -qv "^-" ; then
TASK="$1" TASK="$1"
elif [ "$1" = "-m" ] ; then
MESSAGE="$1 $2"
shift
elif [ "$1" = "--commit" ] ; then elif [ "$1" = "--commit" ] ; then
COMMIT=1 COMMIT=1
elif [ "$1" = "--force" ] ; then elif [ "$1" = "--force" ] ; then
...@@ -220,7 +231,7 @@ if [ "$1" = "run" ] ; then ...@@ -220,7 +231,7 @@ if [ "$1" = "run" ] ; then
# force reset test status # force reset test status
[ -n "$COMMIT" ] && PARAMTEST='--commit' [ -n "$COMMIT" ] && PARAMTEST='--commit'
docmd ssh $GEARHOST task run $PARAMTEST "$TASK" docmd ssh $GEARHOST task run $MESSAGE $PARAMTEST "$TASK"
exit exit
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