Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
bbf393dd95
|
@ -38,6 +38,10 @@ Passing "--prune/-p" does not remove those volumes.`,
|
||||
app := internal.ValidateApp(args)
|
||||
stackName := app.StackName()
|
||||
|
||||
if err := app.Recipe.Ensure(internal.GetEnsureContext()); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
cl, err := client.New(app.Server)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
24
cli/run.go
24
cli/run.go
@ -31,21 +31,21 @@ func Run(version, commit string) {
|
||||
"upgrade",
|
||||
},
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
dirs := []map[string]os.FileMode{
|
||||
{config.ABRA_DIR: 0764},
|
||||
{config.SERVERS_DIR: 0600},
|
||||
{config.RECIPES_DIR: 0764},
|
||||
{config.LOGS_DIR: 0764},
|
||||
paths := []string{
|
||||
config.ABRA_DIR,
|
||||
config.SERVERS_DIR,
|
||||
config.RECIPES_DIR,
|
||||
config.LOGS_DIR,
|
||||
config.VENDOR_DIR, // TODO(d1): remove > 0.9.x
|
||||
config.BACKUP_DIR, // TODO(d1): remove > 0.9.x
|
||||
}
|
||||
|
||||
for _, dir := range dirs {
|
||||
for path, perm := range dir {
|
||||
if err := os.Mkdir(path, perm); err != nil {
|
||||
if !os.IsExist(err) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
continue
|
||||
for _, path := range paths {
|
||||
if err := os.Mkdir(path, 0764); err != nil {
|
||||
if !os.IsExist(err) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,20 @@ teardown(){
|
||||
assert_failure
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "retrieve recipe if missing" {
|
||||
_deploy_app
|
||||
|
||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
assert_success
|
||||
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
|
||||
run $ABRA app undeploy "$TEST_APP_DOMAIN" --no-input
|
||||
assert_success
|
||||
|
||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "ensure recipe up to date if no --offline" {
|
||||
_deploy_app
|
||||
|
@ -24,7 +24,7 @@ setup(){
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "abra directories are created" {
|
||||
@test "abra directory is created" {
|
||||
run $ABRA app ls
|
||||
|
||||
# NOTE(d1): no servers yet, so will fail. however, it will run the required
|
||||
@ -35,9 +35,8 @@ setup(){
|
||||
assert_exists "$ABRA_DIR"
|
||||
assert_exists "$ABRA_DIR/servers"
|
||||
assert_exists "$ABRA_DIR/recipes"
|
||||
assert_exists "$ABRA_DIR/backups"
|
||||
assert_exists "$ABRA_DIR/vendor"
|
||||
|
||||
assert_not_exists "$ABRA_DIR/catalogue"
|
||||
|
||||
server_dir_perms=$(stat -c "%a" "$ABRA_DIR/servers")
|
||||
assert_equal $server_dir_perms "600"
|
||||
}
|
||||
|
Reference in New Issue
Block a user