forked from coop-cloud/abra
refactor: move flag to internal/common
This commit is contained in:
parent
a925da8dee
commit
9ddf69b988
|
@ -284,6 +284,17 @@ var VerboseFlag = &cli.BoolFlag{
|
|||
Usage: "Show INFO messages",
|
||||
}
|
||||
|
||||
// RC signifies the latest release candidate
|
||||
var RC bool
|
||||
|
||||
// RCFlag chooses the latest release candidate for install
|
||||
var RCFlag = &cli.BoolFlag{
|
||||
Name: "rc",
|
||||
Value: false,
|
||||
Destination: &RC,
|
||||
Usage: "Insatll the latest release candidate",
|
||||
}
|
||||
|
||||
// SSHFailMsg is a hopefully helpful SSH failure message
|
||||
var SSHFailMsg = `
|
||||
Woops, Abra is unable to connect to connect to %s.
|
||||
|
|
|
@ -8,22 +8,14 @@ import (
|
|||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var RC bool
|
||||
var RCFlag = &cli.BoolFlag{
|
||||
Name: "rc",
|
||||
Value: false,
|
||||
Destination: &RC,
|
||||
Usage: "Insatll the latest Release Candidate",
|
||||
}
|
||||
|
||||
// UpgradeCommand upgrades abra in-place.
|
||||
var UpgradeCommand = &cli.Command{
|
||||
Name: "upgrade",
|
||||
Usage: "Upgrade abra",
|
||||
Flags: []cli.Flag{RCFlag},
|
||||
Flags: []cli.Flag{internal.RCFlag},
|
||||
Action: func(c *cli.Context) error {
|
||||
cmd := exec.Command("bash", "-c", "curl -s https://install.abra.coopcloud.tech | bash")
|
||||
if RC {
|
||||
if internal.RC {
|
||||
cmd = exec.Command("bash", "-c", "curl -s https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer | bash -s -- --rc")
|
||||
}
|
||||
logrus.Debugf("attempting to run '%s'", cmd)
|
||||
|
|
Loading…
Reference in New Issue