forked from toolshed/abra
fix: handle StackName / Name correctly
This commit is contained in:
@ -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