From 8925fea5dcee82c922a15fcdaa11bb7851f55120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20G=C3=BCntner?= Date: Sat, 20 Jun 2020 19:18:49 +0200 Subject: [PATCH] put static_registry as first argument --- build.sh | 4 ++-- build_containers.sh | 7 ++++--- build_registry.py | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index be9e9d6..3466a05 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -./build_containers.sh -./build_registry.py > static_registry/default.nix +./build_containers.sh $1 +./build_registry.py $1 > ${1}/default.nix diff --git a/build_containers.sh b/build_containers.sh index f98d939..e56146b 100755 --- a/build_containers.sh +++ b/build_containers.sh @@ -1,11 +1,12 @@ #!/usr/bin/env bash set -x -for dir in $(ls static_registry) +BASE=$1 +for dir in $(ls $BASE) do - [ ! -d static_registry/$dir ] && continue + [ ! -d $BASE/$dir ] && continue pushd . echo $dir - cd static_registry/$dir + cd $BASE/$dir COMMIT_HASH=$(docker build . | tail -n 1 | cut -d ' ' -f3) TAG=$(basename $(pwd)):$COMMIT_HASH docker tag $COMMIT_HASH $TAG diff --git a/build_registry.py b/build_registry.py index bc59ac2..660e39e 100755 --- a/build_registry.py +++ b/build_registry.py @@ -1,7 +1,10 @@ #!/usr/bin/env python3 +import sys from pathlib import Path -pathlist = Path("static_registry").glob('**/*.tar.gz') +base = sys.argv[1] + +pathlist = Path(base).glob('**/*.tar.gz') registry = { }