mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-17 13:53:49 +00:00
32 lines
541 B
Bash
32 lines
541 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
function assert_success() {
|
||
|
"${@}"
|
||
|
local status=${?}
|
||
|
if [ ${status} -ne 0 ]; then
|
||
|
echo "### Error ${status} at: ${BASH_LINENO[*]} ###"
|
||
|
exit ${status}
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
function build_and_publish() {
|
||
|
export RELEASE_MODE=true
|
||
|
project="$1"
|
||
|
|
||
|
assert_success ./gradlew clean "$project:clean" "$project:build" "$project:publishToMavenLocal" "$project:bintrayUpload"
|
||
|
}
|
||
|
|
||
|
pids=()
|
||
|
|
||
|
while [ -n "$1" ]
|
||
|
do
|
||
|
build_and_publish "$1" &
|
||
|
pids[${#pids[*]}]=$!
|
||
|
shift
|
||
|
done
|
||
|
|
||
|
for item in ${pids[*]}
|
||
|
do
|
||
|
wait "$item"
|
||
|
done
|