chore: update releases [ci skip]
This commit is contained in:
18
main.go
18
main.go
@@ -46,6 +46,7 @@ var (
|
||||
repoUsername = os.Getenv("REPO_USERNAME") // Git username (if needed)
|
||||
repoPassword = os.Getenv("REPO_PASSWORD") // Git password/token (if needed)
|
||||
tlsSkipVerify = os.Getenv("TLS_SKIP_VERIFY") // "true" / "false"
|
||||
envData = os.Getenv("ENV_DATA") // Optional env vars in JSON format
|
||||
)
|
||||
|
||||
// -------------------------------
|
||||
@@ -106,11 +107,20 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Parse environment variables
|
||||
var envVars []EnvVar = []EnvVar{}
|
||||
if envData != "" {
|
||||
if err := json.Unmarshal([]byte(envData), &envVars); err != nil {
|
||||
fmt.Printf("Error parsing ENV_DATA: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
if existing == nil {
|
||||
// 3. Create new stack
|
||||
// 4. Create new stack
|
||||
payload := map[string]interface{}{
|
||||
"composeFile": repoComposeFile,
|
||||
"env": []EnvVar{},
|
||||
"env": envVars,
|
||||
"fromAppTemplate": false,
|
||||
"name": stackName,
|
||||
"repositoryAuthentication": repoUsername != "" && repoPassword != "",
|
||||
@@ -136,9 +146,9 @@ func main() {
|
||||
|
||||
fmt.Printf("✅ Stack %s deployed successfully.\n", stackName)
|
||||
} else {
|
||||
// 4. Redeploy stack
|
||||
// 5. Redeploy stack
|
||||
payload := map[string]interface{}{
|
||||
"env": []EnvVar{},
|
||||
"env": envVars,
|
||||
"prune": true,
|
||||
"pullImage": true,
|
||||
"repositoryAuthentication": repoUsername != "" && repoPassword != "",
|
||||
|
||||
Reference in New Issue
Block a user