refactor!: --ignore-env-version is --latest *only* on deploy
All checks were successful
continuous-integration/drone/push Build is passing

See #617
This commit is contained in:
2025-08-29 16:28:06 +02:00
parent 86ba006e17
commit d5c66020ad
9 changed files with 179 additions and 89 deletions

View File

@ -262,6 +262,14 @@ func validateArgsAndFlags(args []string) error {
return errors.New(i18n.G("cannot use [version] and --chaos together"))
}
if len(args) == 2 && args[1] != "" && internal.DeployLatest {
return errors.New(i18n.G("cannot use [version] and --latest together"))
}
if internal.DeployLatest && internal.Chaos {
return errors.New(i18n.G("cannot use --chaos and --latest together"))
}
return nil
}
@ -298,7 +306,7 @@ func getDeployVersion(cliArgs []string, deployMeta stack.DeployMeta, app app.App
}
// Check if the recipe has a version in the .env file
if app.Recipe.EnvVersion != "" && !internal.IgnoreEnvVersion {
if app.Recipe.EnvVersion != "" && !internal.DeployLatest {
if strings.HasSuffix(app.Recipe.EnvVersionRaw, "+U") {
return "", errors.New(i18n.G("version: can not redeploy chaos version %s", app.Recipe.EnvVersionRaw))
}
@ -307,7 +315,7 @@ func getDeployVersion(cliArgs []string, deployMeta stack.DeployMeta, app app.App
}
// Take deployed version
if deployMeta.IsDeployed {
if deployMeta.IsDeployed && !internal.DeployLatest {
log.Debug(i18n.G("version: taking deployed version: %s", deployMeta.Version))
return deployMeta.Version, nil
}
@ -352,4 +360,12 @@ func init() {
false,
i18n.G("disable converge logic checks"),
)
AppDeployCommand.PersistentFlags().BoolVarP(
&internal.DeployLatest,
"latest",
"l",
false,
i18n.G("deploy latest recipe version"),
)
}

View File

@ -2,13 +2,13 @@ package internal
var (
// NOTE(d1): global
Debug bool
NoInput bool
Offline bool
IgnoreEnvVersion bool
Debug bool
NoInput bool
Offline bool
// NOTE(d1): sub-command specific
Chaos bool
DeployLatest bool
DontWaitConverge bool
Dry bool
Force bool

View File

@ -6,6 +6,6 @@ func GetEnsureContext() recipe.EnsureContext {
return recipe.EnsureContext{
Chaos,
Offline,
IgnoreEnvVersion,
DeployLatest,
}
}

View File

@ -137,14 +137,6 @@ func Run(version, commit string) {
i18n.G("prefer offline & filesystem access"),
)
rootCmd.PersistentFlags().BoolVarP(
&internal.IgnoreEnvVersion,
"ignore-env-version",
"i",
false,
i18n.G("ignore .env version checkout"),
)
catalogue.CatalogueCommand.AddCommand(
catalogue.CatalogueGenerateCommand,
catalogue.CatalogueSyncCommand,

View File

@ -7,7 +7,7 @@
msgid ""
msgstr "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-08-29 09:54+0200\n"
"POT-Creation-Date: 2025-08-29 16:31+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -552,7 +552,7 @@ msgstr ""
msgid "Both local recipe and live deployment labels are shown."
msgstr ""
#: ./cli/app/backup.go:298 ./cli/app/backup.go:314 ./cli/app/check.go:90 ./cli/app/cmd.go:277 ./cli/app/cp.go:381 ./cli/app/deploy.go:327 ./cli/app/labels.go:138 ./cli/app/new.go:368 ./cli/app/ps.go:209 ./cli/app/restart.go:157 ./cli/app/restore.go:134 ./cli/app/secret.go:553 ./cli/app/secret.go:593 ./cli/app/secret.go:617 ./cli/app/secret.go:625 ./cli/catalogue/catalogue.go:309 ./cli/recipe/lint.go:131 ./cli/updater/updater.go:544
#: ./cli/app/backup.go:298 ./cli/app/backup.go:314 ./cli/app/check.go:90 ./cli/app/cmd.go:277 ./cli/app/cp.go:381 ./cli/app/deploy.go:335 ./cli/app/labels.go:138 ./cli/app/new.go:368 ./cli/app/ps.go:209 ./cli/app/restart.go:157 ./cli/app/restore.go:134 ./cli/app/secret.go:553 ./cli/app/secret.go:593 ./cli/app/secret.go:617 ./cli/app/secret.go:625 ./cli/catalogue/catalogue.go:309 ./cli/recipe/lint.go:131 ./cli/updater/updater.go:544
msgid "C"
msgstr ""
@ -693,7 +693,7 @@ msgid "Creates a new app from a default recipe.\n"
"on your $PATH."
msgstr ""
#: ./cli/app/deploy.go:343 ./cli/app/new.go:344 ./cli/app/rollback.go:332 ./cli/app/upgrade.go:443
#: ./cli/app/deploy.go:351 ./cli/app/new.go:344 ./cli/app/rollback.go:332 ./cli/app/upgrade.go:443
msgid "D"
msgstr ""
@ -1720,7 +1720,7 @@ msgstr ""
msgid "broken symlink in your abra config folders: %s"
msgstr ""
#: ./cli/app/backup.go:140 ./cli/app/cp.go:31 ./cli/app/deploy.go:351 ./cli/app/rollback.go:340 ./cli/app/upgrade.go:451
#: ./cli/app/backup.go:140 ./cli/app/cp.go:31 ./cli/app/deploy.go:359 ./cli/app/rollback.go:340 ./cli/app/upgrade.go:451
msgid "c"
msgstr ""
@ -1785,6 +1785,10 @@ msgstr ""
msgid "cannot use '[secret] [version]' and '--all' together"
msgstr ""
#: ./cli/app/deploy.go:270
msgid "cannot use --chaos and --latest together"
msgstr ""
#: ./cli/app/cmd.go:103
msgid "cannot use --local & --user together"
msgstr ""
@ -1809,6 +1813,10 @@ msgstr ""
msgid "cannot use [version] and --chaos together"
msgstr ""
#: ./cli/app/deploy.go:266
msgid "cannot use [version] and --latest together"
msgstr ""
#: ./cli/run.go:32
msgid "catalogue"
msgstr ""
@ -1834,7 +1842,7 @@ msgstr ""
msgid "cfg"
msgstr ""
#: ./cli/app/backup.go:297 ./cli/app/backup.go:313 ./cli/app/check.go:89 ./cli/app/cmd.go:276 ./cli/app/cp.go:380 ./cli/app/deploy.go:326 ./cli/app/labels.go:137 ./cli/app/new.go:367 ./cli/app/ps.go:208 ./cli/app/restart.go:156 ./cli/app/restore.go:133 ./cli/app/secret.go:552 ./cli/app/secret.go:592 ./cli/app/secret.go:616 ./cli/app/secret.go:624 ./cli/catalogue/catalogue.go:308 ./cli/recipe/lint.go:130 ./cli/updater/updater.go:543
#: ./cli/app/backup.go:297 ./cli/app/backup.go:313 ./cli/app/check.go:89 ./cli/app/cmd.go:276 ./cli/app/cp.go:380 ./cli/app/deploy.go:334 ./cli/app/labels.go:137 ./cli/app/new.go:367 ./cli/app/ps.go:208 ./cli/app/restart.go:156 ./cli/app/restore.go:133 ./cli/app/secret.go:552 ./cli/app/secret.go:592 ./cli/app/secret.go:616 ./cli/app/secret.go:624 ./cli/catalogue/catalogue.go:308 ./cli/recipe/lint.go:130 ./cli/updater/updater.go:543
msgid "chaos"
msgstr ""
@ -2155,6 +2163,10 @@ msgstr ""
msgid "deploy labels stanza present"
msgstr ""
#: ./cli/app/deploy.go:369
msgid "deploy latest recipe version"
msgstr ""
#: ./pkg/upstream/stack/stack.go:637
msgid "deploy succeeded 🟢"
msgstr ""
@ -2228,11 +2240,11 @@ msgstr ""
msgid "dirty: %v, "
msgstr ""
#: ./cli/app/deploy.go:353 ./cli/app/rollback.go:342 ./cli/app/upgrade.go:453
#: ./cli/app/deploy.go:361 ./cli/app/rollback.go:342 ./cli/app/upgrade.go:453
msgid "disable converge logic checks"
msgstr ""
#: ./cli/app/deploy.go:345 ./cli/app/rollback.go:334 ./cli/app/upgrade.go:445
#: ./cli/app/deploy.go:353 ./cli/app/rollback.go:334 ./cli/app/upgrade.go:445
msgid "disable public DNS checks"
msgstr ""
@ -2452,7 +2464,7 @@ msgstr ""
msgid "expected 1 service but found %v: %s"
msgstr ""
#: ./cli/app/deploy.go:335 ./cli/app/remove.go:158 ./cli/app/rollback.go:324 ./cli/app/secret.go:577 ./cli/app/upgrade.go:435 ./cli/app/volume.go:204 ./cli/recipe/fetch.go:20 ./cli/recipe/fetch.go:133
#: ./cli/app/deploy.go:343 ./cli/app/remove.go:158 ./cli/app/rollback.go:324 ./cli/app/secret.go:577 ./cli/app/upgrade.go:435 ./cli/app/volume.go:204 ./cli/recipe/fetch.go:20 ./cli/recipe/fetch.go:133
msgid "f"
msgstr ""
@ -2648,7 +2660,7 @@ msgstr ""
msgid "for %s read env %s with value: %s from docker service"
msgstr ""
#: ./cli/app/deploy.go:334 ./cli/app/remove.go:157 ./cli/app/rollback.go:323 ./cli/app/upgrade.go:434 ./cli/app/volume.go:203 ./cli/recipe/fetch.go:132
#: ./cli/app/deploy.go:342 ./cli/app/remove.go:157 ./cli/app/rollback.go:323 ./cli/app/upgrade.go:434 ./cli/app/volume.go:203 ./cli/recipe/fetch.go:132
msgid "force"
msgstr ""
@ -2845,11 +2857,7 @@ msgstr ""
msgid "id: %s, "
msgstr ""
#: ./cli/run.go:145
msgid "ignore .env version checkout"
msgstr ""
#: ./cli/app/backup.go:300 ./cli/app/backup.go:316 ./cli/app/check.go:92 ./cli/app/cmd.go:279 ./cli/app/cp.go:383 ./cli/app/deploy.go:329 ./cli/app/labels.go:140 ./cli/app/new.go:370 ./cli/app/ps.go:211 ./cli/app/restart.go:159 ./cli/app/restore.go:136 ./cli/app/secret.go:555 ./cli/app/secret.go:595 ./cli/app/secret.go:619 ./cli/app/secret.go:627 ./cli/catalogue/catalogue.go:311 ./cli/recipe/lint.go:133 ./cli/updater/updater.go:546
#: ./cli/app/backup.go:300 ./cli/app/backup.go:316 ./cli/app/check.go:92 ./cli/app/cmd.go:279 ./cli/app/cp.go:383 ./cli/app/deploy.go:337 ./cli/app/labels.go:140 ./cli/app/new.go:370 ./cli/app/ps.go:211 ./cli/app/restart.go:159 ./cli/app/restore.go:136 ./cli/app/secret.go:555 ./cli/app/secret.go:595 ./cli/app/secret.go:619 ./cli/app/secret.go:627 ./cli/catalogue/catalogue.go:311 ./cli/recipe/lint.go:133 ./cli/updater/updater.go:546
msgid "ignore uncommitted recipes changes"
msgstr ""
@ -3454,11 +3462,11 @@ msgstr ""
msgid "no volumes to remove"
msgstr ""
#: ./cli/app/deploy.go:350 ./cli/app/rollback.go:339 ./cli/app/upgrade.go:450
#: ./cli/app/deploy.go:358 ./cli/app/rollback.go:339 ./cli/app/upgrade.go:450
msgid "no-converge-checks"
msgstr ""
#: ./cli/app/deploy.go:342 ./cli/app/rollback.go:331 ./cli/app/upgrade.go:442
#: ./cli/app/deploy.go:350 ./cli/app/rollback.go:331 ./cli/app/upgrade.go:442
msgid "no-domain-checks"
msgstr ""
@ -3590,7 +3598,7 @@ msgstr ""
msgid "pattern"
msgstr ""
#: ./cli/app/deploy.go:337 ./cli/app/remove.go:160 ./cli/app/rollback.go:326 ./cli/app/upgrade.go:437 ./cli/app/volume.go:206
#: ./cli/app/deploy.go:345 ./cli/app/remove.go:160 ./cli/app/rollback.go:326 ./cli/app/upgrade.go:437 ./cli/app/volume.go:206
msgid "perform action without further prompt"
msgstr ""
@ -4130,7 +4138,7 @@ msgstr ""
msgid "secret not found: %s"
msgstr ""
#: ./cli/app/deploy.go:276
#: ./cli/app/deploy.go:284
#, c-format
msgid "secret not generated: %s"
msgstr ""
@ -5004,32 +5012,32 @@ msgstr ""
msgid "version wiped from %s.env"
msgstr ""
#: ./cli/app/deploy.go:303
#: ./cli/app/deploy.go:311
#, c-format
msgid "version: can not redeploy chaos version %s"
msgstr ""
#: ./cli/app/deploy.go:290
#: ./cli/app/deploy.go:298
#, c-format
msgid "version: taking chaos version: %s"
msgstr ""
#: ./cli/app/deploy.go:311
#: ./cli/app/deploy.go:319
#, c-format
msgid "version: taking deployed version: %s"
msgstr ""
#: ./cli/app/deploy.go:316
#: ./cli/app/deploy.go:324
#, c-format
msgid "version: taking new recipe version: %s"
msgstr ""
#: ./cli/app/deploy.go:305
#: ./cli/app/deploy.go:313
#, c-format
msgid "version: taking version from .env file: %s"
msgstr ""
#: ./cli/app/deploy.go:296
#: ./cli/app/deploy.go:304
#, c-format
msgid "version: taking version from cli arg: %s"
msgstr ""

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-08-29 09:54+0200\n"
"POT-Creation-Date: 2025-08-29 16:31+0200\n"
"PO-Revision-Date: 2025-08-29 08:00+0000\n"
"Last-Translator: chasqui <chasqui@cryptolab.net>\n"
"Language-Team: Spanish <https://translate.coopcloud.tech/projects/co-op-"
@ -577,7 +577,7 @@ msgid "Both local recipe and live deployment labels are shown."
msgstr ""
#: cli/app/backup.go:298 cli/app/backup.go:314 cli/app/check.go:90
#: cli/app/cmd.go:277 cli/app/cp.go:381 cli/app/deploy.go:327
#: cli/app/cmd.go:277 cli/app/cp.go:381 cli/app/deploy.go:335
#: cli/app/labels.go:138 cli/app/new.go:368 cli/app/ps.go:209
#: cli/app/restart.go:157 cli/app/restore.go:134 cli/app/secret.go:553
#: cli/app/secret.go:593 cli/app/secret.go:617 cli/app/secret.go:625
@ -743,7 +743,7 @@ msgid ""
"on your $PATH."
msgstr ""
#: cli/app/deploy.go:343 cli/app/new.go:344 cli/app/rollback.go:332
#: cli/app/deploy.go:351 cli/app/new.go:344 cli/app/rollback.go:332
#: cli/app/upgrade.go:443
msgid "D"
msgstr ""
@ -1870,7 +1870,7 @@ msgstr ""
msgid "broken symlink in your abra config folders: %s"
msgstr ""
#: cli/app/backup.go:140 cli/app/cp.go:31 cli/app/deploy.go:351
#: cli/app/backup.go:140 cli/app/cp.go:31 cli/app/deploy.go:359
#: cli/app/rollback.go:340 cli/app/upgrade.go:451
msgid "c"
msgstr ""
@ -1936,6 +1936,10 @@ msgstr ""
msgid "cannot use '[secret] [version]' and '--all' together"
msgstr ""
#: cli/app/deploy.go:270
msgid "cannot use --chaos and --latest together"
msgstr ""
#: cli/app/cmd.go:103
msgid "cannot use --local & --user together"
msgstr ""
@ -1960,6 +1964,10 @@ msgstr ""
msgid "cannot use [version] and --chaos together"
msgstr ""
#: cli/app/deploy.go:266
msgid "cannot use [version] and --latest together"
msgstr ""
#: cli/run.go:32
msgid "catalogue"
msgstr ""
@ -1986,7 +1994,7 @@ msgid "cfg"
msgstr ""
#: cli/app/backup.go:297 cli/app/backup.go:313 cli/app/check.go:89
#: cli/app/cmd.go:276 cli/app/cp.go:380 cli/app/deploy.go:326
#: cli/app/cmd.go:276 cli/app/cp.go:380 cli/app/deploy.go:334
#: cli/app/labels.go:137 cli/app/new.go:367 cli/app/ps.go:208
#: cli/app/restart.go:156 cli/app/restore.go:133 cli/app/secret.go:552
#: cli/app/secret.go:592 cli/app/secret.go:616 cli/app/secret.go:624
@ -2319,6 +2327,11 @@ msgstr ""
msgid "deploy labels stanza present"
msgstr ""
#: cli/app/deploy.go:369
#, fuzzy
msgid "deploy latest recipe version"
msgstr "Publicar una nueva versión de una receta"
#: pkg/upstream/stack/stack.go:637
msgid "deploy succeeded 🟢"
msgstr ""
@ -2392,11 +2405,11 @@ msgstr ""
msgid "dirty: %v, "
msgstr ""
#: cli/app/deploy.go:353 cli/app/rollback.go:342 cli/app/upgrade.go:453
#: cli/app/deploy.go:361 cli/app/rollback.go:342 cli/app/upgrade.go:453
msgid "disable converge logic checks"
msgstr ""
#: cli/app/deploy.go:345 cli/app/rollback.go:334 cli/app/upgrade.go:445
#: cli/app/deploy.go:353 cli/app/rollback.go:334 cli/app/upgrade.go:445
msgid "disable public DNS checks"
msgstr ""
@ -2623,7 +2636,7 @@ msgstr ""
msgid "expected 1 service but found %v: %s"
msgstr ""
#: cli/app/deploy.go:335 cli/app/remove.go:158 cli/app/rollback.go:324
#: cli/app/deploy.go:343 cli/app/remove.go:158 cli/app/rollback.go:324
#: cli/app/secret.go:577 cli/app/upgrade.go:435 cli/app/volume.go:204
#: cli/recipe/fetch.go:20 cli/recipe/fetch.go:133
msgid "f"
@ -2821,7 +2834,7 @@ msgstr ""
msgid "for %s read env %s with value: %s from docker service"
msgstr ""
#: cli/app/deploy.go:334 cli/app/remove.go:157 cli/app/rollback.go:323
#: cli/app/deploy.go:342 cli/app/remove.go:157 cli/app/rollback.go:323
#: cli/app/upgrade.go:434 cli/app/volume.go:203 cli/recipe/fetch.go:132
msgid "force"
msgstr ""
@ -3020,12 +3033,8 @@ msgstr ""
msgid "id: %s, "
msgstr ""
#: cli/run.go:145
msgid "ignore .env version checkout"
msgstr ""
#: cli/app/backup.go:300 cli/app/backup.go:316 cli/app/check.go:92
#: cli/app/cmd.go:279 cli/app/cp.go:383 cli/app/deploy.go:329
#: cli/app/cmd.go:279 cli/app/cp.go:383 cli/app/deploy.go:337
#: cli/app/labels.go:140 cli/app/new.go:370 cli/app/ps.go:211
#: cli/app/restart.go:159 cli/app/restore.go:136 cli/app/secret.go:555
#: cli/app/secret.go:595 cli/app/secret.go:619 cli/app/secret.go:627
@ -3658,11 +3667,11 @@ msgstr ""
msgid "no volumes to remove"
msgstr ""
#: cli/app/deploy.go:350 cli/app/rollback.go:339 cli/app/upgrade.go:450
#: cli/app/deploy.go:358 cli/app/rollback.go:339 cli/app/upgrade.go:450
msgid "no-converge-checks"
msgstr ""
#: cli/app/deploy.go:342 cli/app/rollback.go:331 cli/app/upgrade.go:442
#: cli/app/deploy.go:350 cli/app/rollback.go:331 cli/app/upgrade.go:442
msgid "no-domain-checks"
msgstr ""
@ -3802,7 +3811,7 @@ msgstr ""
msgid "pattern"
msgstr ""
#: cli/app/deploy.go:337 cli/app/remove.go:160 cli/app/rollback.go:326
#: cli/app/deploy.go:345 cli/app/remove.go:160 cli/app/rollback.go:326
#: cli/app/upgrade.go:437 cli/app/volume.go:206
msgid "perform action without further prompt"
msgstr ""
@ -4354,7 +4363,7 @@ msgstr ""
msgid "secret not found: %s"
msgstr ""
#: cli/app/deploy.go:276
#: cli/app/deploy.go:284
#, c-format
msgid "secret not generated: %s"
msgstr ""
@ -5244,32 +5253,32 @@ msgstr ""
msgid "version wiped from %s.env"
msgstr ""
#: cli/app/deploy.go:303
#: cli/app/deploy.go:311
#, c-format
msgid "version: can not redeploy chaos version %s"
msgstr ""
#: cli/app/deploy.go:290
#: cli/app/deploy.go:298
#, c-format
msgid "version: taking chaos version: %s"
msgstr ""
#: cli/app/deploy.go:311
#: cli/app/deploy.go:319
#, c-format
msgid "version: taking deployed version: %s"
msgstr ""
#: cli/app/deploy.go:316
#: cli/app/deploy.go:324
#, c-format
msgid "version: taking new recipe version: %s"
msgstr ""
#: cli/app/deploy.go:305
#: cli/app/deploy.go:313
#, c-format
msgid "version: taking version from .env file: %s"
msgstr ""
#: cli/app/deploy.go:296
#: cli/app/deploy.go:304
#, c-format
msgid "version: taking version from cli arg: %s"
msgstr ""

View File

@ -393,6 +393,91 @@ teardown(){
}
# bats test_tags=slow
@test "deploy latest from undeployed specific version" {
latestRelease=$(_latest_release)
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.0+1.20.0" \
--no-input --no-converge-checks
assert_success
_undeploy_app
run grep -q "TYPE=$TEST_RECIPE:0.1.0+1.20.0" \
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
assert_success
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --latest
assert_success
assert_output --partial "$latestRelease"
run grep -q "TYPE=$TEST_RECIPE:$latestRelease" \
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
assert_success
}
@test "--latest is exclusive" {
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.0+1.20.0" --latest
assert_failure
assert_output --regexp "cannot use .* together"
run $ABRA app deploy "$TEST_APP_DOMAIN" --chaos --latest
assert_failure
assert_output --regexp "cannot use .* together"
}
# bats test_tags=slow
@test "deploy latest after chaos deploy" {
latestRelease=$(_latest_release)
run bash -c "echo foo >> $ABRA_DIR/recipes/$TEST_RECIPE/foo"
assert_success
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --chaos
assert_success
_reset_recipe
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --force --latest
assert_success
assert_output --partial "$latestRelease"
run grep -q "TYPE=$TEST_RECIPE:$latestRelease" \
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
assert_success
}
# bats test_tags=slow
@test "deploy latest after undeployed chaos deploy" {
latestRelease=$(_latest_release)
run bash -c "echo foo >> $ABRA_DIR/recipes/$TEST_RECIPE/foo"
assert_success
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --chaos
assert_success
_reset_recipe
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo"
_undeploy_app
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --latest
assert_success
assert_output --partial "$latestRelease"
run grep -q "TYPE=$TEST_RECIPE:$latestRelease" \
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
assert_success
}
@test "chaos version label includes dirty marker" {
run bash -c "echo foo >> $ABRA_DIR/recipes/$TEST_RECIPE/foo"
assert_success
@ -408,28 +493,7 @@ teardown(){
}
# bats test_tags=slow
@test "ignore env version checkout after deploy" {
tagHash=$(_get_tag_hash "0.1.0+1.20.0")
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.0+1.20.0" \
--no-input --no-converge-checks
assert_success
assert_equal $(_get_current_hash) "$tagHash"
run $ABRA app check --ignore-env-version "$TEST_APP_DOMAIN"
assert_success
assert_equal $(_get_current_hash) "$(_get_head_hash)"
run $ABRA app check "$TEST_APP_DOMAIN"
assert_success
assert_equal $(_get_current_hash) "$tagHash"
}
# bats test_tags=slow
@test "ignore env version on new deploy" {
@test "deploy latest on new deploy" {
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.0+1.20.0" \
--no-input --no-converge-checks
assert_success
@ -439,7 +503,7 @@ teardown(){
latestRelease=$(_latest_release)
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --ignore-env-version
--no-input --no-converge-checks --latest
assert_success
assert_output --partial "$latestRelease"
}

View File

@ -107,7 +107,8 @@ teardown(){
# bats test_tags=slow
@test "takes deployed version when no .env version is present " {
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.0+1.20.0" --no-input --no-converge-checks --ignore-env-version
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.0+1.20.0" \
--no-input --no-converge-checks
assert_success
run grep -q "TYPE=$TEST_RECIPE:0.1.0+1.20.0" \

View File

@ -86,7 +86,7 @@ teardown(){
assert_success
}
@test "deploy, re-deploy, ignore env version" {
@test "deploy, re-deploy, deploy latest" {
latestRelease=$(_latest_release)
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.1+1.20.2" \
@ -96,7 +96,7 @@ teardown(){
_undeploy_app
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --ignore-env-version
--no-input --no-converge-checks --latest
assert_success
assert_output --partial 'NEW DEPLOY OVERVIEW'