diff --git a/plugins/app-json/appjson.go b/plugins/app-json/appjson.go index c8ea7b763..631037f57 100644 --- a/plugins/app-json/appjson.go +++ b/plugins/app-json/appjson.go @@ -25,7 +25,12 @@ type AppJSON struct { func constructScript(command string, shell string, isHerokuishImage bool, hasEntrypoint bool) []string { if hasEntrypoint { - return []string{command} + words, err := shellquote.Split(strings.TrimSpace(command)) + if err != nil { + common.LogWarn(fmt.Sprintf("Skiiping command construction for app with ENTRYPOINT: %v", err.Error())) + return nil + } + return words } script := []string{"set -eo pipefail;"} diff --git a/tests/unit/app-json.bats b/tests/unit/app-json.bats index 2c4d6517a..ace12b935 100644 --- a/tests/unit/app-json.bats +++ b/tests/unit/app-json.bats @@ -70,22 +70,11 @@ teardown() { } @test "(app-json) app.json dockerfile entrypoint" { - run deploy_app dockerfile-entrypoint + run deploy_app dockerfile-entrypoint dokku@dokku.me:$TEST_APP add_release_command echo "output: $output" echo "status: $status" assert_success - - run docker inspect "dokku/${TEST_APP}:latest" --format "{{json .Config.Cmd}}" - echo "output: $output" - echo "status: $status" - assert_success - assert_output 'null' - - run docker inspect "dokku/${TEST_APP}:latest" --format "{{json .Config.Entrypoint}}" - echo "output: $output" - echo "status: $status" - assert_success - assert_output '["./entrypoint"]' + assert_output_contains "touch /app/release.test" } @test "(app-json) app.json dockerfile release" { diff --git a/tests/unit/test_helper.bash b/tests/unit/test_helper.bash index dc29a93c0..e3fe5c21a 100644 --- a/tests/unit/test_helper.bash +++ b/tests/unit/test_helper.bash @@ -450,6 +450,13 @@ some lame nginx config EOF } +add_release_command() { + local APP="$1" + local APP_REPO_DIR="$2" + [[ -z "$APP" ]] && local APP="$TEST_APP" + echo "release: touch /app/release.test" >> "$APP_REPO_DIR/Procfile" +} + build_nginx_config() { # simulate nginx post-deploy dokku domains:setup "$TEST_APP"