From 600dd1c30a58083eb13ba7c6a5107c1666d09759 Mon Sep 17 00:00:00 2001 From: Clemens Date: Wed, 6 Mar 2024 15:35:11 +0100 Subject: [PATCH] add hugo to image & generate netrc file --- infrastructure/build/image/resources/entrypoint.sh | 2 ++ infrastructure/build/image/resources/functions.sh | 5 +++++ infrastructure/build/image/resources/install.sh | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/infrastructure/build/image/resources/entrypoint.sh b/infrastructure/build/image/resources/entrypoint.sh index 05c3610..485a546 100755 --- a/infrastructure/build/image/resources/entrypoint.sh +++ b/infrastructure/build/image/resources/entrypoint.sh @@ -20,6 +20,8 @@ if [[ $currentHash == $newHash ]] echo "Nothing to do" else echo $currentHash > $HASHFILEDIR/$hashfilename + echo "Generate .netrc file" + generate-netrc-file echo "Downloading website data" get-website-data $filename unzip-website-data $filename diff --git a/infrastructure/build/image/resources/functions.sh b/infrastructure/build/image/resources/functions.sh index d105f6a..af2e7f5 100644 --- a/infrastructure/build/image/resources/functions.sh +++ b/infrastructure/build/image/resources/functions.sh @@ -1,5 +1,10 @@ #!/bin/bash +# TODO provide GITHOST +function generate-netrc-file() { + echo "machine $GITHOST password $AUTHTOKEN" > ~/.netrc +} + function get-website-data() { curl -H "Authorization: token $AUTHTOKEN" -o $SOURCEDIR/$1 $GITREPOURL } diff --git a/infrastructure/build/image/resources/install.sh b/infrastructure/build/image/resources/install.sh index 79a1c59..7616996 100755 --- a/infrastructure/build/image/resources/install.sh +++ b/infrastructure/build/image/resources/install.sh @@ -6,7 +6,7 @@ function main() { { upgradeSystem - apt-get install -qqy unzip rsync jq imagemagick curl + apt-get install -qqy unzip rsync jq imagemagick curl hugo install -d /etc/lein/ install -m 0700 /tmp/entrypoint.sh /