forked from toolshed/abra
		
	| @ -109,6 +109,13 @@ var AppNewCommand = &cobra.Command{ | |||||||
| 				if err := recipe.EnsureLatest(); err != nil { | 				if err := recipe.EnsureLatest(); err != nil { | ||||||
| 					log.Fatal(err) | 					log.Fatal(err) | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
|  | 				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()) | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | |||||||
| @ -68,3 +68,27 @@ teardown(){ | |||||||
|   assert_output --partial 'fooUser' |   assert_output --partial 'fooUser' | ||||||
|   assert_output --partial 'foo@example.com' |   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 | ||||||
|  | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user