forked from toolshed/abra
fix: handle StackName / Name correctly
This commit is contained in:
@ -133,10 +133,9 @@ can take some time.
|
||||
totalAppsCount++
|
||||
|
||||
if status {
|
||||
stackName := app.StackName()
|
||||
status := "unknown"
|
||||
version := "unknown"
|
||||
if statusMeta, ok := statuses[stackName]; ok {
|
||||
if statusMeta, ok := statuses[app.StackName()]; ok {
|
||||
if currentVersion, exists := statusMeta["version"]; exists {
|
||||
version = currentVersion
|
||||
}
|
||||
@ -191,7 +190,7 @@ can take some time.
|
||||
|
||||
appStats.server = app.Server
|
||||
appStats.recipe = app.Type
|
||||
appStats.appName = app.StackName()
|
||||
appStats.appName = app.Name
|
||||
appStats.domain = app.Domain
|
||||
|
||||
stats.apps = append(stats.apps, appStats)
|
||||
|
@ -175,7 +175,7 @@ recipes.
|
||||
}
|
||||
}
|
||||
|
||||
if err := stack.RunDeploy(cl, deployOpts, compose, app.Type, internal.DontWaitConverge); err != nil {
|
||||
if err := stack.RunDeploy(cl, deployOpts, compose, app.StackName(), internal.DontWaitConverge); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ volumes as eligiblef or pruning once undeployed.
|
||||
}
|
||||
|
||||
if !isDeployed {
|
||||
logrus.Fatalf("%s is not deployed?", stackName)
|
||||
logrus.Fatalf("%s is not deployed?", app.Name)
|
||||
}
|
||||
|
||||
if err := internal.DeployOverview(app, deployedVersion, "continue with undeploy?"); err != nil {
|
||||
|
@ -188,7 +188,7 @@ recipes.
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := stack.RunDeploy(cl, deployOpts, compose, app.Type, internal.DontWaitConverge); err != nil {
|
||||
if err := stack.RunDeploy(cl, deployOpts, compose, app.StackName(), internal.DontWaitConverge); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ import (
|
||||
// DeployAction is the main command-line action for this package
|
||||
func DeployAction(c *cli.Context) error {
|
||||
app := ValidateApp(c)
|
||||
stackName := app.StackName()
|
||||
|
||||
if err := recipe.EnsureUpToDate(app.Type); err != nil {
|
||||
logrus.Fatal(err)
|
||||
@ -43,18 +42,18 @@ func DeployAction(c *cli.Context) error {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
logrus.Debugf("checking whether %s is already deployed", stackName)
|
||||
logrus.Debugf("checking whether %s is already deployed", app.StackName())
|
||||
|
||||
isDeployed, deployedVersion, err := stack.IsDeployed(c.Context, cl, stackName)
|
||||
isDeployed, deployedVersion, err := stack.IsDeployed(c.Context, cl, app.StackName())
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if isDeployed {
|
||||
if Force || Chaos {
|
||||
logrus.Warnf("%s is already deployed but continuing (--force/--chaos)", stackName)
|
||||
logrus.Warnf("%s is already deployed but continuing (--force/--chaos)", app.Name)
|
||||
} else {
|
||||
logrus.Fatalf("%s is already deployed", stackName)
|
||||
logrus.Fatalf("%s is already deployed", app.Name)
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,7 +123,7 @@ func DeployAction(c *cli.Context) error {
|
||||
}
|
||||
deployOpts := stack.Deploy{
|
||||
Composefiles: composeFiles,
|
||||
Namespace: stackName,
|
||||
Namespace: app.StackName(),
|
||||
Prune: false,
|
||||
ResolveImage: stack.ResolveImageAlways,
|
||||
}
|
||||
@ -151,7 +150,7 @@ func DeployAction(c *cli.Context) error {
|
||||
logrus.Warn("skipping domain checks as requested")
|
||||
}
|
||||
|
||||
if err := stack.RunDeploy(cl, deployOpts, compose, app.Env["TYPE"], DontWaitConverge); err != nil {
|
||||
if err := stack.RunDeploy(cl, deployOpts, compose, app.Name, DontWaitConverge); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
@ -173,7 +172,7 @@ func DeployOverview(app config.App, version, message string) error {
|
||||
server = "local"
|
||||
}
|
||||
|
||||
table.Append([]string{server, deployConfig, app.Domain, app.StackName(), version})
|
||||
table.Append([]string{server, deployConfig, app.Domain, app.Name, version})
|
||||
table.Render()
|
||||
|
||||
if NoInput {
|
||||
@ -211,7 +210,7 @@ func NewVersionOverview(app config.App, currentVersion, newVersion, releaseNotes
|
||||
server = "local"
|
||||
}
|
||||
|
||||
table.Append([]string{server, deployConfig, app.Domain, app.StackName(), currentVersion, newVersion})
|
||||
table.Append([]string{server, deployConfig, app.Domain, app.Name, currentVersion, newVersion})
|
||||
table.Render()
|
||||
|
||||
if releaseNotes == "" {
|
||||
|
Reference in New Issue
Block a user