fix: pass command directly to entrypoint

Closes #3706
This commit is contained in:
Jose Diaz-Gonzalez
2020-08-31 18:36:07 -04:00
parent 7fe69fa269
commit 2b65def123
4 changed files with 59 additions and 19 deletions

View File

@@ -1,4 +1,9 @@
#!/bin/bash
set -o pipefail
echo "entrypoint script started with arguments $@"
exec "$@"
if [[ "$1" == touch* ]]; then
echo "entrypoint script started with arguments $@"
touch "$(echo $@ | awk '{print $2}')"
else
exec "$@"
fi

View File

@@ -101,3 +101,17 @@ teardown() {
assert_output_contains "SECRET_KEY: fjdkslafjdk"
assert_success
}
@test "(app-json) app.json dockerfile entrypoint" {
run deploy_app dockerfile-entrypoint
echo "output: $output"
echo "status: $status"
assert_output_contains "Executing predeploy task from app.json"
assert_output_contains "entrypoint script started with arguments touch /app/predeploy.test"
assert_success
run /bin/bash -c "dokku --rm run $TEST_APP ls /app/predeploy.test"
echo "output: $output"
echo "status: $status"
assert_success
}