support scripts.dokku in app.json. closes #1824
This commit is contained in:
38
tests/apps/nodejs-express/app.json
Normal file
38
tests/apps/nodejs-express/app.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "Sample node.js express app",
|
||||
"description": "Used in dokku's test suite",
|
||||
"keywords": [
|
||||
"nodejs",
|
||||
"express",
|
||||
"testing"
|
||||
],
|
||||
"website": "http://dokku.viewdocs.io/dokku/",
|
||||
"repository": "https://github.com/dokku/dokku",
|
||||
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
|
||||
"scripts": {
|
||||
"dokku": {
|
||||
"predeploy": "touch /app/predeploy.test",
|
||||
"postdeploy": "touch /app/postdeploy.test"
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"SECRET_TOKEN": {
|
||||
"description": "A secret key for verifying the integrity of signed cookies.",
|
||||
"value": "secret"
|
||||
},
|
||||
"WEB_CONCURRENCY": {
|
||||
"description": "The number of processes to run.",
|
||||
"generator": "echo 5"
|
||||
}
|
||||
},
|
||||
"image": "gliderlabs/herokuish",
|
||||
"addons": [
|
||||
"dokku-postgres",
|
||||
"dokku-redis"
|
||||
],
|
||||
"buildpacks": [
|
||||
{
|
||||
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -146,3 +146,24 @@ EOF
|
||||
echo "status: "$status
|
||||
assert_output "3001/udp 3000/tcp 3003"
|
||||
}
|
||||
|
||||
@test "(core) app.json scripts" {
|
||||
deploy_app
|
||||
|
||||
run /bin/bash -c "dokku run $TEST_APP ls /app/prebuild.test"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_failure
|
||||
|
||||
run /bin/bash -c "dokku run $TEST_APP ls /app/predeploy.test"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
CID=$(docker ps -a -q -f "ancestor=dokku/${TEST_APP}" -f "label=dokku_phase_script=postdeploy")
|
||||
IMAGE_ID=$(docker commit $CID dokku-test/${TEST_APP})
|
||||
run /bin/bash -c "docker run -ti $IMAGE_ID ls /app/postdeploy.test"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user