Compare commits
1 Commits
fb6e4150ba
...
0ef51e7ccf
Author | SHA1 | Date | |
---|---|---|---|
0ef51e7ccf |
@ -185,6 +185,15 @@ var AppNewCommand = &cobra.Command{
|
||||
newAppServer = "local"
|
||||
}
|
||||
|
||||
if recipeVersion == "" {
|
||||
head, err := recipe.Head()
|
||||
if err != nil {
|
||||
log.Fatalf("failed to retrieve latest commit for %s: %s", recipe.Name, err)
|
||||
}
|
||||
|
||||
recipeVersion = formatter.SmallSHA(head.String())
|
||||
}
|
||||
|
||||
log.Infof("%s created (version: %s)", appDomain, recipeVersion)
|
||||
|
||||
if len(appSecrets) > 0 {
|
||||
|
@ -68,3 +68,27 @@ teardown(){
|
||||
assert_output --partial 'fooUser'
|
||||
assert_output --partial 'foo@example.com'
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "recipe new, app new, no releases, latest commit" {
|
||||
recipeName="foobar"
|
||||
|
||||
run $ABRA recipe new "$recipeName"
|
||||
assert_success
|
||||
assert_exists "$ABRA_DIR/recipes/$recipeName"
|
||||
|
||||
currentHash=$(git -C "$ABRA_DIR/recipes/$recipeName" show -s --format="%H")
|
||||
domain="$recipeName.$TEST_APP_SERVER"
|
||||
|
||||
run $ABRA app new "$recipeName" \
|
||||
--no-input \
|
||||
--server "$TEST_SERVER" \
|
||||
--domain "$domain"
|
||||
assert_success
|
||||
assert_output --partial "version: ${currentHash:0:8}"
|
||||
assert_exists "$ABRA_DIR/servers/$TEST_SERVER/$domain.env"
|
||||
|
||||
run grep -q "TYPE=$recipeName:${currentHash:0:8}" \
|
||||
"$ABRA_DIR/servers/$TEST_SERVER/$domain.env"
|
||||
assert_success
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user