From bcad22b0674a4857af32c9fd61ea3304bcb1f4fb Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 28 Sep 2022 10:26:50 +0200 Subject: [PATCH] [Skip-Ci] Refactoring --- .../c4k-website-build/image/resources/functions.sh | 2 +- src/main/cljc/dda/c4k_website/website.cljc | 8 ++++---- src/main/resources/website/website-build-secret.yaml | 2 +- src/test/cljc/dda/c4k_website/website_test.cljc | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/infrastructure/c4k-website-build/image/resources/functions.sh b/infrastructure/c4k-website-build/image/resources/functions.sh index fbc6773..db40a61 100644 --- a/infrastructure/c4k-website-build/image/resources/functions.sh +++ b/infrastructure/c4k-website-build/image/resources/functions.sh @@ -1,7 +1,7 @@ #!/bin/bash function get-and-unzip-website-data() { - curl -H "Authorization: token $AUTHTOKEN" -O $REPOZIPURL # REPOZIPURL = https://your.gitea.host/api/v1/repos///archive/main.zip + curl -H "Authorization: token $AUTHTOKEN" -O $GITREPOURL # GITREPURL = https://your.gitea.host/api/v1/repos///archive/main.zip mkdir $BUILDDIR unzip main.zip -D $BUILDDIR } diff --git a/src/main/cljc/dda/c4k_website/website.cljc b/src/main/cljc/dda/c4k_website/website.cljc index dfd9a01..dd01cb6 100644 --- a/src/main/cljc/dda/c4k_website/website.cljc +++ b/src/main/cljc/dda/c4k_website/website.cljc @@ -137,10 +137,10 @@ (defn-spec generate-website-build-secret pred/map-or-seq? [auth auth?] (let [{:keys [fqdn - token - url]} auth] + authtoken + gitrepourl]} auth] (-> (yaml/load-as-edn "website/website-build-secret.yaml") (replace-all-matching-subvalues-in-string-start "NAME" (unique-name-from-fqdn fqdn)) - (cm/replace-all-matching-values-by-new-value "TOKEN" (b64/encode token)) - (cm/replace-all-matching-values-by-new-value "URL" (b64/encode url))))) \ No newline at end of file + (cm/replace-all-matching-values-by-new-value "TOKEN" (b64/encode authtoken)) + (cm/replace-all-matching-values-by-new-value "URL" (b64/encode gitrepourl))))) \ No newline at end of file diff --git a/src/main/resources/website/website-build-secret.yaml b/src/main/resources/website/website-build-secret.yaml index 8a57cdb..e21583f 100644 --- a/src/main/resources/website/website-build-secret.yaml +++ b/src/main/resources/website/website-build-secret.yaml @@ -4,5 +4,5 @@ metadata: name: NAME-secret data: AUTHTOKEN: TOKEN - REPOZIPURL: URL + GITREPOURL: URL \ No newline at end of file diff --git a/src/test/cljc/dda/c4k_website/website_test.cljc b/src/test/cljc/dda/c4k_website/website_test.cljc index f826920..a1f4571 100644 --- a/src/test/cljc/dda/c4k_website/website_test.cljc +++ b/src/test/cljc/dda/c4k_website/website_test.cljc @@ -139,14 +139,14 @@ :name-c2 "test-com-secret", :AUTHTOKEN-c1 (b64/encode "token1"), :AUTHTOKEN-c2 (b64/encode "token2"), - :REPOZIPURL-c1 (b64/encode "test.de/user/repo.git"), - :REPOZIPURL-c2 (b64/encode "test.com/user/repo.git")} + :GITREPOURL-c1 (b64/encode "test.de/user/repo.git"), + :GITREPOURL-c2 (b64/encode "test.com/user/repo.git")} (th/map-diff (cut/generate-website-build-secret {:fqdn "test.de" - :token "token1" - :url "test.de/user/repo.git"}) + :authtoken "token1" + :gitrepourl "test.de/user/repo.git"}) (cut/generate-website-build-secret {:fqdn "test.com" - :token "token2" - :url "test.com/user/repo.git"}))))) + :authtoken "token2" + :gitrepourl "test.com/user/repo.git"}))))) (deftest should-generate-website-content-volume