Merge pull request #4233 from dokku/4232-fix-release-command

Properly parse releease command when there is an entrypoint
This commit is contained in:
Jose Diaz-Gonzalez
2020-12-12 15:57:38 -05:00
committed by GitHub
3 changed files with 15 additions and 14 deletions

View File

@@ -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("Skipping command construction for app with ENTRYPOINT: %v", err.Error()))
return nil
}
return words
}
script := []string{"set -eo pipefail;"}

View File

@@ -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" {

View File

@@ -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"