Adjustment Deployment

This commit is contained in:
mr
2026-01-19 11:24:16 +01:00
parent 1b77b8b6cf
commit 827b6f4211
955 changed files with 81 additions and 138174 deletions

View File

@@ -67,10 +67,12 @@ func Create_Helm(args ...string) error {
folder = args[0]
}
clusterName := "opencloud"
host := "beta.opencloud.com"
if b, err := os.ReadFile(folder + "/" + release + "-values.yaml"); err == nil {
clusterName, _ = utils.Extract(string(b), "clusterName")
host, _ = utils.Extract(string(b), "host")
}
if len(args) > 1 {
release = args[1]
}
@@ -111,6 +113,10 @@ func Create_Helm(args ...string) error {
utils.Exec("kind export logs ./kind-logs")
utils.Exec("sudo rm -rf " + tmp)
utils.Exec("sudo sed -i.bak \"/[[:space:]]" + host + "$/d\" /etc/hosts")
utils.Exec("sudo sed -i.bak \"/[[:space:]]" + host + "$/d\" /etc/hosts")
utils.Exec("echo \"$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type==\"InternalIP\")].address}') " + host + "\" | sudo tee -a /etc/hosts > /dev/null")
return nil
}

View File

@@ -52,9 +52,11 @@ func Create_Service(args ...string) error {
if len(args) > 4 {
target = args[4]
}
scheme := "http"
hostname := "beta.opencloud.com"
if b, err := os.ReadFile(folder + "/" + release + "-values.yaml"); err == nil {
hostname, _ = utils.Extract(string(b), "host")
scheme, _ = utils.Extract(string(b), "scheme")
}
for _, repo := range REPOS {
@@ -76,7 +78,7 @@ func Create_Service(args ...string) error {
return err
}
if err := utils.Exec("cd " + repo + " && export HOST=" + hostname + " && export KUBERNETES_SERVICE_HOST=" + host + " && export KUBERNETES_SERVICE_PORT=" + port + " && export KUBE_CA=" + ca + " && export KUBE_CERT=" + cert + " && export KUBE_DATA=" + key + " && make " + target); err != nil {
if err := utils.Exec("cd " + repo + " && export HOST=" + scheme + "://" + hostname + " && export KUBERNETES_SERVICE_HOST=" + host + " && export KUBERNETES_SERVICE_PORT=" + port + " && export KUBE_CA=" + ca + " && export KUBE_CERT=" + cert + " && export KUBE_DATA=" + key + " && make " + target); err != nil {
return err
}