Skip to content

Commit

Permalink
0.0.4 - fixed create bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Stan Bondi committed Oct 2, 2017
1 parent e268aab commit 078ca70
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,23 @@ func ensureSecretsForRepo(client drone.Client, manifestSecret *mfst.SecretDef, r
secret.Value = string(out)
}

_, err = client.SecretCreate(owner, name, secret)
_, err = client.Secret(owner, name, secret.Name)
if err != nil {
fmt.Printf("%s %s\n", Green("✓"), Bold(secret.Name))
_, uerr := client.SecretUpdate(owner, name, secret)
if uerr != nil {
fmt.Printf("%s %s\n", Green("✓"), Bold(secret.Name))
} else {
fmt.Printf("%s %s.\n", Red("✕"), Bold(secret.Name))
return uerr
}
} else {
fmt.Printf("%s %s.\n", Red("✕"), Bold(secret.Name))
fmt.Println(err)
_, uerr := client.SecretCreate(owner, name, secret)
if uerr != nil {
fmt.Printf("%s %s\n", Green("✓"), Bold(secret.Name))
} else {
fmt.Printf("%s %s.\n", Red("✕"), Bold(secret.Name))
return uerr
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/urfave/cli"
)

const version string = "0.0.3"
const version string = "0.0.4"

func main() {
app := cli.NewApp()
Expand Down

0 comments on commit 078ca70

Please sign in to comment.