Merge pull request #8114 from dokku/8052-run-exec
Ensure we can execute run commands when exec is executed as part of an entrypoint
This commit is contained in:
@@ -109,7 +109,8 @@ trigger-scheduler-docker-local-scheduler-run() {
|
|||||||
if [[ -n "$PROC_CMD" ]]; then
|
if [[ -n "$PROC_CMD" ]]; then
|
||||||
dokku_log_info1_quiet "Found '$POTENTIAL_PROCFILE_KEY' in Procfile, running that command"
|
dokku_log_info1_quiet "Found '$POTENTIAL_PROCFILE_KEY' in Procfile, running that command"
|
||||||
DOCKER_ARGS+=" --label=com.dokku.process-type=$POTENTIAL_PROCFILE_KEY"
|
DOCKER_ARGS+=" --label=com.dokku.process-type=$POTENTIAL_PROCFILE_KEY"
|
||||||
set -- "$PROC_CMD" "${@:2}"
|
read -ra proc_array <<<"$PROC_CMD"
|
||||||
|
set -- "${proc_array[@]}" "${@:2}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
4
tests/apps/python/exec-entrypoint.sh
Executable file
4
tests/apps/python/exec-entrypoint.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
11
tests/apps/python/exec.Dockerfile
Normal file
11
tests/apps/python/exec.Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM python:3.12.6-bookworm
|
||||||
|
|
||||||
|
EXPOSE 3001/udp
|
||||||
|
EXPOSE 3000/tcp
|
||||||
|
EXPOSE 3003
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/exec-entrypoint.sh"]
|
||||||
1
tests/apps/python/exec.Procfile
Normal file
1
tests/apps/python/exec.Procfile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
task: echo 'hi dokku'
|
||||||
@@ -51,6 +51,35 @@ teardown() {
|
|||||||
assert_output_contains 'echo hi' 0
|
assert_output_contains 'echo hi' 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(builder-dockerfile) exec" {
|
||||||
|
run /bin/bash -c "dokku builder-dockerfile:set $TEST_APP dockerfile-path exec.Dockerfile"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku app-json:set $TEST_APP appjson-path app.json-fake"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku ps:set $TEST_APP procfile-path exec.Procfile"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku run $TEST_APP task"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains "Found 'task' in Procfile, running that command"
|
||||||
|
assert_output_contains 'hi dokku'
|
||||||
|
}
|
||||||
|
|
||||||
@test "(builder-dockerfile) config export" {
|
@test "(builder-dockerfile) config export" {
|
||||||
run /bin/bash -c "dokku config:set $TEST_APP GITHUB_TOKEN=custom-value"
|
run /bin/bash -c "dokku config:set $TEST_APP GITHUB_TOKEN=custom-value"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
|
|||||||
Reference in New Issue
Block a user