mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #4233 from dokku/4232-fix-release-command
Properly parse releease command when there is an entrypoint
This commit is contained in:
@@ -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;"}
|
||||
|
||||
@@ -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" {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user