forked from toolshed/abra
parent
eb6fe4ba6e
commit
ed263854d4
@ -64,6 +64,15 @@ func NewVersionOverview(
|
||||
|
||||
upperKind := strings.ToUpper(kind)
|
||||
|
||||
envVersion, err := recipe.GetEnvVersionRaw(app.Recipe.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if envVersion == "" {
|
||||
envVersion = config.NO_VERSION_DEFAULT
|
||||
}
|
||||
|
||||
rows := [][]string{
|
||||
{"DOMAIN", domain},
|
||||
{"RECIPE", app.Recipe.Name},
|
||||
@ -78,7 +87,7 @@ func NewVersionOverview(
|
||||
{"VERSION", formatter.BoldDirtyDefault(toDeployVersion)},
|
||||
|
||||
{fmt.Sprintf("%s.ENV", strings.ToUpper(app.Domain)), "---"},
|
||||
{"CURRENT VERSION", formatter.BoldDirtyDefault(app.Recipe.EnvVersion)},
|
||||
{"CURRENT VERSION", formatter.BoldDirtyDefault(envVersion)},
|
||||
{"NEW VERSION", formatter.BoldDirtyDefault(toDeployVersion)},
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ setup(){
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_reset_app
|
||||
_undeploy_app
|
||||
_reset_recipe
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ setup(){
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_reset_app
|
||||
_undeploy_app
|
||||
_reset_recipe
|
||||
}
|
||||
@ -74,3 +75,30 @@ teardown(){
|
||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "app rollback no .env version" {
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.2.0+1.21.0" \
|
||||
--no-input --no-converge-checks
|
||||
assert_success
|
||||
|
||||
_wipe_env_version
|
||||
|
||||
run $ABRA app rollback "$TEST_APP_DOMAIN" "0.1.0+1.20.0" \
|
||||
--no-input --no-converge-checks
|
||||
assert_success
|
||||
|
||||
# current deployment
|
||||
assert_output --regexp 'VERSION.*' + "0.2.0+1.21.0"
|
||||
assert_output --regexp 'CHAOS.*false'
|
||||
|
||||
# rollback
|
||||
assert_output --regexp 'VERSION.*' + "0.1.0+1.20.0"
|
||||
|
||||
# env version
|
||||
assert_output --regexp 'CURRENT VERSION.*N/A'
|
||||
assert_output --regexp 'NEW VERSION.*' + "0.2.0+1.21.0"
|
||||
|
||||
run grep -q "TYPE=$TEST_RECIPE:${latestRelease}" \
|
||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||
assert_success
|
||||
}
|
||||
|
@ -73,3 +73,33 @@ teardown(){
|
||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "app upgrade no .env version" {
|
||||
latestRelease=$(_latest_release)
|
||||
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.2.0+1.21.0" \
|
||||
--no-input --no-converge-checks
|
||||
assert_success
|
||||
|
||||
_wipe_env_version
|
||||
|
||||
run $ABRA app upgrade "$TEST_APP_DOMAIN" \
|
||||
--no-input --no-converge-checks --force
|
||||
assert_success
|
||||
|
||||
# current deployment
|
||||
assert_output --regexp 'VERSION.*' + "0.2.0+1.21.0"
|
||||
assert_output --regexp 'CHAOS.*false'
|
||||
|
||||
# upgrade
|
||||
assert_output --regexp 'VERSION.*' + "0.2.0+1.21.0"
|
||||
assert_output --regexp 'CHAOS.*false'
|
||||
|
||||
# env version
|
||||
assert_output --regexp 'CURRENT VERSION.*N/A'
|
||||
assert_output --regexp 'NEW VERSION.*' + "0.2.0+1.21.0"
|
||||
|
||||
run grep -q "TYPE=$TEST_RECIPE:${latestRelease}" \
|
||||
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
||||
assert_success
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user