Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
8d518aa1
Commit
8d518aa1
authored
Feb 11, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitask: rewrite run and commit commands as one case
parent
dbdbacb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
42 deletions
+12
-42
gitask
bin/gitask
+12
-42
No files found.
bin/gitask
View file @
8d518aa1
...
...
@@ -165,28 +165,6 @@ if [ "$1" = "add" ] ; then
fi
fi
if
[
"
$1
"
=
"commit"
]
;
then
shift
COMMIT
=
''
MESSAGE
=
''
if
[
"
$1
"
=
"-m"
]
;
then
MESSAGE
=
"
$1
${
2
/ /_
}
"
shift
2
fi
TASKLIST
=
"
$*
"
if
[
-z
"
$TASKLIST
"
]
;
then
TASKLIST
=
"
$(
get_last
)
"
||
fatal
"Can't get last task"
fi
for
TASK
in
$TASKLIST
;
do
docmd ssh
$GEARHOST
task run
$MESSAGE
--commit
"
$TASK
"
done
exit
fi
if
[
"
$1
"
=
"show"
]
;
then
shift
COMMIT
=
''
...
...
@@ -198,40 +176,32 @@ if [ "$1" = "show" ] ; then
exit
fi
if
[
"
$1
"
=
"run"
]
;
then
if
[
"
$1
"
=
"run"
]
||
[
"
$1
"
=
"commit"
]
;
then
COMMIT
=
''
[
"
$1
"
=
"commit"
]
&&
COMMIT
=
"--commit"
shift
COMMIT
=
''
PARAMTEST
=
''
TASK
=
''
TASKLIST
=
''
MESSAGE
=
''
while
[
-n
"
$1
"
]
;
do
# TODO: check for number?
if
echo
"
$1
"
|
grep
-qv
"^-"
;
then
TASK
=
"
$1
"
TASK
LIST
=
"
$TASKLIST
$1
"
elif
[
"
$1
"
=
"-m"
]
;
then
MESSAGE
=
"
$1
${
2
/ /_
}
"
MESSAGE
=
"
$1
${
2
/
/
/_
}
"
shift
elif
[
"
$1
"
=
"--commit"
]
;
then
COMMIT
=
1
elif
[
"
$1
"
=
"--force"
]
;
then
COMMIT
=
1
elif
[
"
$1
"
=
"--test"
]
||
[
"
$1
"
=
"--test-only"
]
;
then
PARAMTEST
=
'--test-only'
else
info
"Unknown param
$1
"
fatal
"Unknown param
$1
"
fi
shift
done
[
-n
"
$TASK
"
]
||
TASK
=
"
$(
get_last
)
"
||
fatal
"Can't get last task"
# keep test status
get_test_status
"
$TASK
"
&&
PARAMTEST
=
'--test-only'
# force reset test status
[
-n
"
$COMMIT
"
]
&&
PARAMTEST
=
'--commit'
[
-n
"
$TASKLIST
"
]
||
TASKLIST
=
"
$(
get_last
)
"
||
fatal
"Can't get last task"
docmd ssh
$GEARHOST
task run
$MESSAGE
$PARAMTEST
"
$TASK
"
for
TASK
in
$TASKLIST
;
do
docmd ssh
$GEARHOST
task run
$MESSAGE
$COMMIT
"
$TASK
"
done
exit
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment