added git host as env var

This commit is contained in:
Clemens 2024-03-07 12:12:37 +01:00
parent 548dd14091
commit ebca7a3454
5 changed files with 5 additions and 4 deletions

View file

@ -1,8 +1,7 @@
#!/bin/bash #!/bin/bash
# TODO provide GITHOST
function generate-netrc-file() { function generate-netrc-file() {
echo "machine $GITHOST password $AUTHTOKEN" > ~/.netrc echo "machine $GIT_HOST password $AUTHTOKEN" > ~/.netrc
} }
function get-website-data() { function get-website-data() {

View file

@ -78,7 +78,6 @@
(-> unsorted-auth (-> unsorted-auth
(assoc-in [:websiteauths] sorted-auth)))) (assoc-in [:websiteauths] sorted-auth))))
; TODO: Replace this with a function that merges defaults into website config
(defn-spec flatten-and-reduce-config map? (defn-spec flatten-and-reduce-config map?
[config config?] [config config?]
(let (let

View file

@ -115,6 +115,7 @@
(-> (->
(yaml/load-as-edn "website/build-configmap.yaml") (yaml/load-as-edn "website/build-configmap.yaml")
(replace-all-matching-prefixes "NAME" name) (replace-all-matching-prefixes "NAME" name)
(cm/replace-all-matching-values-by-new-value "GITHOST" forgejo-host)
(cm/replace-all-matching-values-by-new-value "REPOURL" (generate-gitrepourl (cm/replace-all-matching-values-by-new-value "REPOURL" (generate-gitrepourl
forgejo-host forgejo-host
repo-user repo-user

View file

@ -6,5 +6,6 @@ metadata:
labels: labels:
app.kubernetes.part-of: NAME-website app.kubernetes.part-of: NAME-website
data: data:
GIT_HOST: GITHOST
GITREPOURL: REPOURL GITREPOURL: REPOURL
GITCOMMITURL: COMMITURL GITCOMMITURL: COMMITURL

View file

@ -236,7 +236,8 @@
:namespace "test-io", :namespace "test-io",
:labels {:app.kubernetes.part-of "test-io-website"}}, :labels {:app.kubernetes.part-of "test-io-website"}},
:data :data
{:GITREPOURL "https://mygit.de/api/v1/repos/someuser/repo/archive/main.zip" {:GIT_HOST "mygit.de"
:GITREPOURL "https://mygit.de/api/v1/repos/someuser/repo/archive/main.zip"
:GITCOMMITURL "https://mygit.de/api/v1/repos/someuser/repo/git/commits/HEAD"}} :GITCOMMITURL "https://mygit.de/api/v1/repos/someuser/repo/git/commits/HEAD"}}
(cut/generate-build-configmap {:issuer "staging" (cut/generate-build-configmap {:issuer "staging"
:build-cpu-request "500m" :build-cpu-request "500m"