Speed up the 'make run-dev' command (#6362)
This commit is contained in:
parent
b9ca06af25
commit
473c742681
2
Makefile
2
Makefile
@ -11,7 +11,7 @@ run-service-tests:
|
||||
git submodule foreach 'make run-tests'
|
||||
|
||||
build-dev:
|
||||
git submodule foreach 'make build-dev'
|
||||
./dev-commands/submodules-do.sh 'make build-dev'
|
||||
make -C proxy build-dev
|
||||
|
||||
run-dev: | build-dev
|
||||
|
23
dev-commands/submodules-do.sh
Executable file
23
dev-commands/submodules-do.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# This script runs a command in every registered submodule parallel
|
||||
# Credits go to https://stackoverflow.com/a/70418086
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Missing Command" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COMMAND="$@"
|
||||
|
||||
IFS=$'\n'
|
||||
for DIR in $(git submodule foreach --recursive -q sh -c pwd); do
|
||||
printf "\n\"${DIR}\": \"${COMMAND}\" started!\n" \
|
||||
&& \
|
||||
cd "$DIR" \
|
||||
&& \
|
||||
eval "$COMMAND" \
|
||||
&& \
|
||||
printf "\"${DIR}\": \"${COMMAND}\" finished!\n" \
|
||||
&
|
||||
done
|
||||
wait
|
@ -23,9 +23,9 @@ function pull_latest_commit {
|
||||
local BRANCH_NAME=$(get_upstream_branch)
|
||||
local REMOTE_NAME=$(get_upstream_name)
|
||||
|
||||
echo "git fetch $REMOTE_NAME && git checkout $REMOTE_NAME/$BRANCH_NAME ..."
|
||||
git fetch $REMOTE_NAME;
|
||||
git checkout $REMOTE_NAME/$BRANCH_NAME;
|
||||
echo "git checkout $BRANCH_NAME && git pull $REMOTE_NAME $BRANCH_NAME ..."
|
||||
git checkout -B $BRANCH_NAME;
|
||||
git pull $REMOTE_NAME $BRANCH_NAME;
|
||||
}
|
||||
|
||||
export -f pull_latest_commit
|
||||
|
Loading…
Reference in New Issue
Block a user