abra/cli/app/deploy.go

46 lines
1.1 KiB
Go
Raw Normal View History

package app
import (
2021-09-01 12:03:39 +00:00
"fmt"
"coopcloud.tech/abra/cli/internal"
2021-09-05 19:37:03 +00:00
"coopcloud.tech/abra/pkg/config"
2021-09-01 12:03:39 +00:00
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
)
2021-09-01 12:03:39 +00:00
var appDeployCommand = &cli.Command{
2021-09-04 23:34:56 +00:00
Name: "deploy",
Aliases: []string{"d"},
Usage: "Deploy an app",
Flags: []cli.Flag{
internal.ForceFlag,
internal.ChaosFlag,
},
Description: `
This command deploys a new instance of an app. It does not support changing the
version of an existing deployed app, for this you need to look at the "abra app
upgrade <app>" command.
You may pass "--force" to re-deploy the same version again. This can be useful
2021-10-18 06:35:59 +00:00
if the container runtime has gotten into a weird state.
Chas mode ("--chaos") will deploy your local checkout of a recipe as-is,
including unstaged changes and can be useful for live hacking and testing new
recipes.
`,
Action: internal.DeployAction,
BashComplete: func(c *cli.Context) {
appNames, err := config.GetAppNames()
2021-09-01 12:03:39 +00:00
if err != nil {
logrus.Warn(err)
2021-09-01 12:03:39 +00:00
}
if c.NArg() > 0 {
return
}
for _, a := range appNames {
fmt.Println(a)
}
},
}