chore: update main.go

This commit is contained in:
etwodev
2025-10-05 21:59:28 +01:00
parent 79564638df
commit abd1e76cd3

View File

@@ -194,6 +194,10 @@ func Deploy(cfg Config) error {
},
}
// print payload for debugging
payloadBytes, _ := json.MarshalIndent(payload, "", " ")
fmt.Printf("Payload: %s\n", string(payloadBytes))
url := fmt.Sprintf("%s/stacks/create/standalone/repository?endpointId=%d", cfg.PortainerURL, cfg.EndpointID)
resp, err := request(client, cfg.PortainerToken, "POST", url, payload)
if err != nil {
@@ -247,6 +251,10 @@ func (s *Stack) Redeploy(cfg Config) error {
"stackName": cfg.StackName,
}
// print payload for debugging
payloadBytes, _ := json.MarshalIndent(payload, "", " ")
fmt.Printf("Payload: %s\n", string(payloadBytes))
url := fmt.Sprintf("%s/stacks/%d/git/redeploy?endpointId=%d", cfg.PortainerURL, s.ID, cfg.EndpointID)
resp, err := request(client, cfg.PortainerToken, "PUT", url, payload)
if err != nil {