[Skip-Ci] Refactoring
This commit is contained in:
parent
4a21794c04
commit
bcad22b067
4 changed files with 12 additions and 12 deletions
|
@ -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/<owner>/<repo>/archive/main.zip
|
||||
curl -H "Authorization: token $AUTHTOKEN" -O $GITREPOURL # GITREPURL = https://your.gitea.host/api/v1/repos/<owner>/<repo>/archive/main.zip
|
||||
mkdir $BUILDDIR
|
||||
unzip main.zip -D $BUILDDIR
|
||||
}
|
||||
|
|
|
@ -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)))))
|
||||
(cm/replace-all-matching-values-by-new-value "TOKEN" (b64/encode authtoken))
|
||||
(cm/replace-all-matching-values-by-new-value "URL" (b64/encode gitrepourl)))))
|
|
@ -4,5 +4,5 @@ metadata:
|
|||
name: NAME-secret
|
||||
data:
|
||||
AUTHTOKEN: TOKEN
|
||||
REPOZIPURL: URL
|
||||
GITREPOURL: URL
|
||||
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue