Merge pull request #6275 from dokku/6205-update-checks-warning

Update message referencing CHECKS file usage to app.json
This commit is contained in:
Jose Diaz-Gonzalez
2023-10-15 01:28:24 -04:00
committed by GitHub
48 changed files with 376 additions and 141 deletions

View File

@@ -11,11 +11,11 @@
},
{
"name": "docker-container-healthchecker",
"version": "0.6.4",
"version": "0.7.1",
"urls": {
"amd64": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.6.4/docker-container-healthchecker_0.6.4_linux_amd64.tgz",
"arm4": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.6.4/docker-container-healthchecker_0.6.4_linux_arm64.tgz",
"arm": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.6.4/docker-container-healthchecker_0.6.4_linux_armhf.tgz"
"amd64": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.7.1/docker-container-healthchecker_0.7.1_linux_amd64.tgz",
"arm4": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.7.1/docker-container-healthchecker_0.7.1_linux_arm64.tgz",
"arm": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.7.1/docker-container-healthchecker_0.7.1_linux_armhf.tgz"
}
},
{

View File

@@ -67,10 +67,15 @@ scheduler-docker-local-pre-deploy-precheck() {
declare APP="$1"
dokku_log_info2 "Processing deployment checks"
if ! fn-scheduler-docker-local-has-checks-file "$APP"; then
local TMP_APP_JSON_OUTPUT=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX")
trap "rm -rf '$TMP_APP_JSON_OUTPUT' >/dev/null" RETURN INT TERM EXIT
plugn trigger app-json-get-content "$APP" >"$TMP_APP_JSON_OUTPUT"
if ! docker-container-healthchecker exists web --app-json "$TMP_APP_JSON_OUTPUT"; then
local CHECKS_URL="${DOKKU_CHECKS_URL:-https://dokku.com/docs/deployment/zero-downtime-deploys/}"
dokku_log_verbose "No CHECKS file found. Simple container checks will be performed."
dokku_log_verbose "For more efficient zero downtime deployments, create a CHECKS file. See ${CHECKS_URL} for examples"
dokku_log_verbose "No web healthchecks found in app.json. Simple container checks will be performed."
dokku_log_verbose "For more efficient zero downtime deployments, add healthchecks to your app.json. See ${CHECKS_URL} for examples"
fi
}

View File

@@ -1,2 +0,0 @@
ATTEMPTS=2
/

View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"attempts": 2,
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1,5 +0,0 @@
WAIT=2 # wait 2 seconds
TIMEOUT=5 # set timeout to 5 seconds
ATTEMPTS=2 # try 2 times
/ nodejs/express

View File

@@ -1,7 +1,20 @@
{
"formation": {
"web": {
"quantity": 1
}
"formation": {
"web": {
"quantity": 1
}
},
"healthchecks": {
"web": [
{
"attempts": 2,
"content": "nodejs/express",
"name": "check-1",
"path": "/",
"timeout": 5,
"type": "startup",
"wait": 2
}
]
}
}

View File

@@ -1,5 +0,0 @@
WAIT=2 # wait 2 seconds
TIMEOUT=5 # set timeout to 5 seconds
ATTEMPTS=2 # try 2 times
/ Hello World!

View File

@@ -0,0 +1,15 @@
{
"healthchecks": {
"web": [
{
"attempts": 2,
"content": "Hello World!",
"name": "check-1",
"path": "/",
"timeout": 5,
"type": "startup",
"wait": 2
}
]
}
}

View File

@@ -1,5 +0,0 @@
WAIT=2 # wait 2 seconds
TIMEOUT=5 # set timeout to 5 seconds
ATTEMPTS=2 # try 2 times
/ nodejs/express

View File

@@ -0,0 +1,15 @@
{
"healthchecks": {
"web": [
{
"attempts": 2,
"content": "nodejs/express",
"name": "check-1",
"path": "/",
"timeout": 5,
"type": "startup",
"wait": 2
}
]
}
}

View File

@@ -1,5 +0,0 @@
WAIT=2 # wait 2 seconds
TIMEOUT=5 # set timeout to 5 seconds
ATTEMPTS=2 # try 2 times
/ nodejs/express

View File

@@ -1,8 +1,21 @@
{
"healthchecks": {
"web": [
{
"attempts": 2,
"content": "nodejs/express",
"name": "check-1",
"path": "/",
"timeout": 5,
"type": "startup",
"wait": 2
}
]
},
"scripts": {
"dokku": {
"predeploy": "touch /app/predeploy.test",
"postdeploy": "touch /app/postdeploy.test"
"postdeploy": "touch /app/postdeploy.test",
"predeploy": "touch /app/predeploy.test"
}
}
}
}

View File

@@ -1,5 +0,0 @@
WAIT=2 # wait 2 seconds
TIMEOUT=5 # set timeout to 5 seconds
ATTEMPTS=2 # try 2 times
/ Hello World!

View File

@@ -1,20 +1,14 @@
{
"name": "Sample node.js express app",
"description": "Used in dokku's test suite",
"keywords": [
"nodejs",
"express",
"testing"
"addons": [
"dokku-postgres",
"dokku-redis"
],
"website": "https://dokku.com/docs/",
"repository": "https://github.com/dokku/dokku",
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
"scripts": {
"dokku": {
"predeploy": "mkdir -p /app && touch /app/predeploy.test",
"postdeploy": "mkdir -p /app && touch /app/postdeploy.test"
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
}
},
],
"description": "Used in dokku's test suite",
"env": {
"SECRET_TOKEN": {
"description": "A secret key for verifying the integrity of signed cookies.",
@@ -25,14 +19,33 @@
"generator": "echo 5"
}
},
"healthchecks": {
"web": [
{
"attempts": 2,
"content": "Hello World!",
"name": "check-1",
"path": "/",
"timeout": 5,
"type": "startup",
"wait": 2
}
]
},
"image": "gliderlabs/herokuish:latest-22",
"addons": [
"dokku-postgres",
"dokku-redis"
"keywords": [
"nodejs",
"express",
"testing"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
"name": "Sample node.js express app",
"repository": "https://github.com/dokku/dokku",
"scripts": {
"dokku": {
"postdeploy": "mkdir -p /app \u0026\u0026 touch /app/postdeploy.test",
"predeploy": "mkdir -p /app \u0026\u0026 touch /app/predeploy.test"
}
]
}
},
"website": "https://dokku.com/docs/"
}

View File

@@ -1 +0,0 @@
/ Hello

View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "Hello",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1 +0,0 @@
/ go

View File

@@ -1,17 +1,27 @@
{
"name": "Sample go app",
"description": "Used in dokku's test suite",
"website": "https://dokku.com/docs/",
"repository": "https://github.com/dokku/dokku",
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
"scripts": {
"dokku": {
"postdeploy": "touch /app/postdeploy.test && ls -la /app"
}
},
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-go"
}
]
}
],
"description": "Used in dokku's test suite",
"healthchecks": {
"web": [
{
"content": "go",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
},
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
"name": "Sample go app",
"repository": "https://github.com/dokku/dokku",
"scripts": {
"dokku": {
"postdeploy": "touch /app/postdeploy.test \u0026\u0026 ls -la /app"
}
},
"website": "https://dokku.com/docs/"
}

View File

@@ -1 +0,0 @@
/ go

View File

@@ -1,17 +1,27 @@
{
"name": "Sample go app",
"description": "Used in dokku's test suite",
"website": "https://dokku.com/docs/",
"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 && ls -la /app"
}
},
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-go"
}
]
}
],
"description": "Used in dokku's test suite",
"healthchecks": {
"web": [
{
"content": "go",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
},
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
"name": "Sample go app",
"repository": "https://github.com/dokku/dokku",
"scripts": {
"dokku": {
"predeploy": "touch /app/predeploy.test \u0026\u0026 ls -la /app"
}
},
"website": "https://dokku.com/docs/"
}

View File

@@ -1 +0,0 @@
/ go

12
tests/apps/go/app.json Normal file
View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "go",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1 +0,0 @@
/ Hello from Java

12
tests/apps/java/app.json Normal file
View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "Hello from Java",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1 +0,0 @@
/ Heroku Multi Buildpack on Dokku

12
tests/apps/multi/app.json Normal file
View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "Heroku Multi Buildpack on Dokku",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1,5 +0,0 @@
WAIT=2 # wait 2 seconds
TIMEOUT=5 # set timeout to 5 seconds
ATTEMPTS=2 # try 2 times
/ nodejs/express

View File

@@ -0,0 +1,15 @@
{
"healthchecks": {
"web": [
{
"attempts": 2,
"content": "nodejs/express",
"name": "check-1",
"path": "/",
"timeout": 5,
"type": "startup",
"wait": 2
}
]
}
}

View File

@@ -1 +0,0 @@
/ nodejs/express

View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "nodejs/express",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1,5 +0,0 @@
WAIT=2 # wait 2 seconds
TIMEOUT=5 # set timeout to 5 seconds
ATTEMPTS=2 # try 2 times
/ nodejs/express

View File

@@ -1,20 +1,14 @@
{
"name": "Sample node.js express app",
"description": "Used in dokku's test suite",
"keywords": [
"nodejs",
"express",
"testing"
"addons": [
"dokku-postgres",
"dokku-redis"
],
"website": "https://dokku.com/docs/",
"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"
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
}
},
],
"description": "Used in dokku's test suite",
"env": {
"SECRET_TOKEN": {
"description": "A secret key for verifying the integrity of signed cookies.",
@@ -25,14 +19,33 @@
"generator": "echo 5"
}
},
"healthchecks": {
"web": [
{
"attempts": 2,
"content": "nodejs/express",
"name": "check-1",
"path": "/",
"timeout": 5,
"type": "startup",
"wait": 2
}
]
},
"image": "gliderlabs/herokuish:latest-22",
"addons": [
"dokku-postgres",
"dokku-redis"
"keywords": [
"nodejs",
"express",
"testing"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
"name": "Sample node.js express app",
"repository": "https://github.com/dokku/dokku",
"scripts": {
"dokku": {
"postdeploy": "touch /app/postdeploy.test",
"predeploy": "touch /app/predeploy.test"
}
]
}
},
"website": "https://dokku.com/docs/"
}

View File

@@ -1 +0,0 @@
/ <html><h3>php</h3></html>

12
tests/apps/php/app.json Normal file
View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "\u003chtml\u003e\u003ch3\u003ephp\u003c/h3\u003e\u003c/html\u003e",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1 +0,0 @@
/ python/flask

View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "python/flask",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1,5 +0,0 @@
WAIT=2 # wait 2 seconds
TIMEOUT=5 # set timeout to 5 seconds
ATTEMPTS=2 # try 2 times
/ python/http.server

View File

@@ -1,8 +1,21 @@
{
"healthchecks": {
"web": [
{
"attempts": 2,
"content": "python/http.server",
"name": "check-1",
"path": "/",
"timeout": 5,
"type": "startup",
"wait": 2
}
]
},
"scripts": {
"dokku": {
"predeploy": "touch /app/predeploy.test",
"postdeploy": "touch /app/postdeploy.test"
"postdeploy": "touch /app/postdeploy.test",
"predeploy": "touch /app/predeploy.test"
}
}
}
}

View File

@@ -1 +0,0 @@
/ Hello, world

12
tests/apps/ruby/app.json Normal file
View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "Hello, world",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1 +0,0 @@
/ Static Page

View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "Static Page",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1 +0,0 @@
/ go

View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "go",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1 +0,0 @@
/ go

View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "go",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}

View File

@@ -1 +0,0 @@
/ go

View File

@@ -0,0 +1,12 @@
{
"healthchecks": {
"web": [
{
"content": "go",
"name": "check-1",
"path": "/",
"type": "startup"
}
]
}
}