diff --git a/plugins/app-json/subcommands.go b/plugins/app-json/subcommands.go index f402dd354..b2f396281 100644 --- a/plugins/app-json/subcommands.go +++ b/plugins/app-json/subcommands.go @@ -24,6 +24,6 @@ func CommandReport(appName string, format string, infoFlag string) error { // CommandSet set or clear a builder property for an app func CommandSet(appName string, property string, value string) error { - common.CommandPropertySet("builder", appName, property, value, DefaultProperties, GlobalProperties) + common.CommandPropertySet("app-json", appName, property, value, DefaultProperties, GlobalProperties) return nil } diff --git a/tests/apps/python/app2.json b/tests/apps/python/app2.json new file mode 100644 index 000000000..dddcc032b --- /dev/null +++ b/tests/apps/python/app2.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "dokku": { + "predeploy": "touch /app/predeploy2.test", + "postdeploy": "touch /app/postdeploy.test" + } + } +} diff --git a/tests/unit/app-json.bats b/tests/unit/app-json.bats index 31d99d365..5e297ed21 100644 --- a/tests/unit/app-json.bats +++ b/tests/unit/app-json.bats @@ -151,3 +151,29 @@ teardown() { echo "status: $status" assert_success } + +@test "(app-json:set)" { + run /bin/bash -c "dokku app-json:set $TEST_APP appjson-path app2.json" + echo "output: $output" + echo "status: $status" + assert_success + + run deploy_app python + echo "output: $output" + echo "status: $status" + assert_success + assert_output_contains "touch /app/predeploy2.test" + + run /bin/bash -c "dokku app-json:set $TEST_APP appjson-path" + echo "output: $output" + echo "status: $status" + assert_success + + run /bin/bash -c "dokku ps:rebuild $TEST_APP" + echo "output: $output" + echo "status: $status" + assert_success + assert_output_contains "touch /app/predeploy.test" + assert_output_contains "touch /app/predeploy2.test" 0 + +}