kadabra, the app auto-updater #268
|
@ -105,21 +105,22 @@ var UpgradeApp = cli.Command{
|
|||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
} else {
|
||||
stacks, err := stack.GetStacks(cl)
|
||||
return nil
|
||||
moritz marked this conversation as resolved
Outdated
|
||||
}
|
||||
|
||||
stacks, err := stack.GetStacks(cl)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
for _, stackInfo := range stacks {
|
||||
stackName := stackInfo.Name
|
||||
recipeName, err := getLabel(cl, stackName, "recipe")
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
for _, stackInfo := range stacks {
|
||||
stackName := stackInfo.Name
|
||||
recipeName, err := getLabel(cl, stackName, "recipe")
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
err = tryUpgrade(cl, stackName, recipeName)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
err = tryUpgrade(cl, stackName, recipeName)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
@ -309,7 +310,6 @@ func mergeAbraShEnv(recipeName string, env config.AppEnv) error {
|
|||
|
||||
// createDeployConfig merges and enriches the compose config for the deployment
|
||||
func createDeployConfig(recipeName string, stackName string, env config.AppEnv) (*composetypes.Config, stack.Deploy, error) {
|
||||
// Workaround, is there a better way?
|
||||
env["STACK_NAME"] = stackName
|
||||
moritz marked this conversation as resolved
Outdated
decentral1se
commented
If you have accesss to the If you have accesss to the `config.App` you can `app.StackName()` but if you only have the app, then this is fine? What might be an issue is that `StackName()`does some trimming logic? Maybe a good idea to call it before and pass it in?
|
||||
|
||||
deployOpts := stack.Deploy{
|
||||
|
|
|
@ -486,7 +486,7 @@ If a service is failing to even start, try smoke out the error with:
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: Copypasta from https://github.com/docker/cli/blob/master/cli/command/stack/swarm/list.go because I could't import "github.com/docker/cli/cli/command/stack/swarm"
|
||||
// Copypasta from https://github.com/docker/cli/blob/master/cli/command/stack/swarm/list.go
|
||||
moritz marked this conversation as resolved
Outdated
decentral1se
commented
Fine to remove this imho, perhaps keep reference to where it came from but remove the Fine to remove this imho, perhaps keep reference to where it came from but remove the `FIXME`, I mean?
|
||||
// GetStacks lists the swarm stacks.
|
||||
func GetStacks(cl *dockerClient.Client) ([]*formatter.Stack, error) {
|
||||
services, err := cl.ServiceList(
|
||||
|
|
Loading…
Reference in New Issue
I think it may make sense to document here that we're accepting a
<stack_name>
and not an<app_name>
because we don't have access to the~/.abra/...
files? Further context on when and where this is supposed to be run?