tests: do not modify the existing app.json via jq
The jq binary doesn't support jsonc, so we can't modify it for testing purposes. Instead, just create an app.json with the correct heroku.postdeploy task.
This commit is contained in:
@@ -47,7 +47,12 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "(app-json) app.json scripts postdeploy" {
|
||||
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP add_postdeploy_command
|
||||
run /bin/bash -c "dokku app-json:set $TEST_APP appjson-path app-heroku-postdeploy.json"
|
||||
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
|
||||
|
||||
@@ -561,15 +561,6 @@ add_release_command() {
|
||||
echo "release: touch /app/release.test" >>"$APP_REPO_DIR/Procfile"
|
||||
}
|
||||
|
||||
add_postdeploy_command() {
|
||||
local APP="$1"
|
||||
local APP_REPO_DIR="$2"
|
||||
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
||||
touch "$APP_REPO_DIR/app.json"
|
||||
contents=$(jq '.scripts.postdeploy = "touch /app/heroku-postdeploy.test"' "$APP_REPO_DIR/app.json")
|
||||
echo "${contents}" >"$APP_REPO_DIR/app.json"
|
||||
}
|
||||
|
||||
move_dockerfile_into_place() {
|
||||
local APP="$1"
|
||||
local APP_REPO_DIR="$2"
|
||||
|
||||
Reference in New Issue
Block a user