Parametrized count of runs via JOBS environment varriable

This commit is contained in:
Václav Valíček (YCNet) 2018-02-13 14:53:59 +01:00
parent 7d910a3aa0
commit 3b757304f7
No known key found for this signature in database
GPG Key ID: 7CF44871CEA75938
2 changed files with 4 additions and 3 deletions

View File

@ -27,10 +27,10 @@ launcher:
docker build -t $(TAGBASE)-launcher ./launcher-image docker build -t $(TAGBASE)-launcher ./launcher-image
run-launcher: launcher run-launcher: launcher
docker run -v /var/run/docker.sock:/var/run/docker.sock -it --rm $(TAGBASE)-launcher docker run -e JOBS=4 -v /var/run/docker.sock:/var/run/docker.sock -it --rm $(TAGBASE)-launcher
run-launcher-detached: launcher run-launcher-detached: launcher
docker run -v /var/run/docker.sock:/var/run/docker.sock -itd --rm $(TAGBASE)-launcher docker run -e JOBS=8 -v /var/run/docker.sock:/var/run/docker.sock -itd --rm $(TAGBASE)-launcher
# wizzard # wizzard
wizzard: mirror run-creator wizzard: mirror run-creator

View File

@ -8,6 +8,7 @@ lock=/var/run/cloner.pid
volume_prefix=cloner volume_prefix=cloner
clone_prefix=cloner-runner clone_prefix=cloner-runner
max_jobs=${JOBS:-3}
function die(){ function die(){
echo $@ 1>&2 echo $@ 1>&2
@ -35,5 +36,5 @@ function listVolumes(){
} }
# run for every volume in parallel # run for every volume in parallel
listVolumes | parallel --lb -j 3 -n 1 run-mirror-update listVolumes | parallel --lb -j $max_jobs -n 1 run-mirror-update