Skip to content

Commit

Permalink
revamps
Browse files Browse the repository at this point in the history
  • Loading branch information
m-adawi committed Aug 22, 2024
1 parent b4f0571 commit 4d8ed50
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions swarmcd/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"text/template"

"github.com/docker/cli/cli/command/stack"
"github.com/go-git/go-git/v5"
// "github.com/go-git/go-git/v5"
"github.com/goccy/go-yaml"
"github.com/m-adawi/swarm-cd/util"
Expand Down Expand Up @@ -36,33 +37,33 @@ type composeObject struct {


func (swarmStack *swarmStack) updateStack() (revision string, err error) {
// revision, err = swarmStack.repo.pullChanges(swarmStack.branch)
// if err != nil && err != git.NoErrAlreadyUpToDate {
// return
// }
revision, err = swarmStack.repo.pullChanges(swarmStack.branch)
if err != nil && err != git.NoErrAlreadyUpToDate {
return
}

err = swarmStack.decryptSopsFiles()
if err != nil {
return "", fmt.Errorf("failed to decrypt one or more sops files for %s stack: %w", swarmStack.name, err)
}

if swarmStack.valuesFile != "" {
err = swarmStack.renderAllTemplates()
err = swarmStack.renderAllTemplates()
if err != nil {
return
}
}

err = swarmStack.rotateConfigsAndSecrets()
err = swarmStack.rotateConfigsAndSecrets()
if err != nil {
return
}

err = swarmStack.deployStack()
err = swarmStack.deployStack()
if err != nil {
return
}
return
return
}

func (swarmStack *swarmStack) decryptSopsFiles() (err error) {
Expand Down

0 comments on commit 4d8ed50

Please sign in to comment.