forked from toolshed/abra
@ -61,18 +61,22 @@ func NewVersionOverview(
|
||||
domain = config.NO_DOMAIN_DEFAULT
|
||||
}
|
||||
|
||||
upperKind := strings.ToUpper(kind)
|
||||
|
||||
rows := [][]string{
|
||||
{"APP", domain},
|
||||
{"RECIPE", app.Recipe.Name},
|
||||
{"SERVER", server},
|
||||
{"DEPLOYED", deployedVersion},
|
||||
{"CURRENT CHAOS ", deployedChaosVersion},
|
||||
{fmt.Sprintf("TO %s", strings.ToUpper(kind)), toDeployVersion},
|
||||
{"CONFIG", deployConfig},
|
||||
{"CURRENT DEPLOYMENT", "---"},
|
||||
{"VERSION", deployedVersion},
|
||||
{"CHAOS ", deployedChaosVersion},
|
||||
{upperKind, "---"},
|
||||
{"VERSION", toDeployVersion},
|
||||
}
|
||||
|
||||
overview := formatter.CreateOverview(
|
||||
fmt.Sprintf("%s OVERVIEW", strings.ToUpper(kind)),
|
||||
fmt.Sprintf("%s OVERVIEW", upperKind),
|
||||
rows,
|
||||
)
|
||||
|
||||
@ -131,15 +135,25 @@ func DeployOverview(
|
||||
domain = config.NO_DOMAIN_DEFAULT
|
||||
}
|
||||
|
||||
deployedChaosVersion = formatter.BoldDirtyDefault(deployedChaosVersion)
|
||||
|
||||
if app.Recipe.Dirty {
|
||||
toDeployChaosVersion = formatter.BoldDirtyDefault(toDeployChaosVersion)
|
||||
}
|
||||
|
||||
rows := [][]string{
|
||||
{"APP", domain},
|
||||
{"RECIPE", app.Recipe.Name},
|
||||
{"SERVER", server},
|
||||
{"DEPLOYED", deployedVersion},
|
||||
{"CURRENT CHAOS ", deployedChaosVersion},
|
||||
{"TO DEPLOY", toDeployVersion},
|
||||
{"NEW CHAOS", toDeployChaosVersion},
|
||||
{"CONFIG", deployConfig},
|
||||
|
||||
{"CURRENT DEPLOYMENT", "---"},
|
||||
{"VERSION", deployedVersion},
|
||||
{"CHAOS", deployedChaosVersion},
|
||||
|
||||
{"NEW DEPLOYMENT", "---"},
|
||||
{"VERSION", toDeployVersion},
|
||||
{"CHAOS", toDeployChaosVersion},
|
||||
}
|
||||
|
||||
overview := formatter.CreateOverview("DEPLOY OVERVIEW", rows)
|
||||
@ -187,13 +201,18 @@ func UndeployOverview(
|
||||
domain = config.NO_DOMAIN_DEFAULT
|
||||
}
|
||||
|
||||
if app.Recipe.Dirty {
|
||||
chaosVersion = formatter.BoldDirtyDefault(chaosVersion)
|
||||
}
|
||||
|
||||
rows := [][]string{
|
||||
{"APP", domain},
|
||||
{"RECIPE", app.Recipe.Name},
|
||||
{"SERVER", server},
|
||||
{"CONFIG", deployConfig},
|
||||
{"CURRENT DEPLOYMENT", "---"},
|
||||
{"DEPLOYED", version},
|
||||
{"CHAOS", chaosVersion},
|
||||
{"CONFIG", deployConfig},
|
||||
}
|
||||
|
||||
overview := formatter.CreateOverview("UNDEPLOY OVERVIEW", rows)
|
||||
|
17
cli/internal/deploy_test.go
Normal file
17
cli/internal/deploy_test.go
Normal file
@ -0,0 +1,17 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSortVersionsDesc(t *testing.T) {
|
||||
versions := SortVersionsDesc([]string{
|
||||
"0.2.3+1.2.2",
|
||||
"1.0.0+2.2.2",
|
||||
})
|
||||
|
||||
assert.Equal(t, "1.0.0+2.2.2", versions[0])
|
||||
assert.Equal(t, "0.2.3+1.2.2", versions[1])
|
||||
}
|
Reference in New Issue
Block a user