test: ensure that the worker upstream exists
This commit is contained in:
@@ -76,6 +76,7 @@ teardown() {
|
||||
add_domain "wildcard1.dokku.me"
|
||||
add_domain "wildcard2.dokku.me"
|
||||
deploy_app nodejs-express dokku@dokku.me:$TEST_APP custom_ssl_nginx_template
|
||||
|
||||
assert_ssl_domain "wildcard1.dokku.me"
|
||||
assert_ssl_domain "wildcard2.dokku.me"
|
||||
assert_http_redirect "http://${CUSTOM_TEMPLATE_SSL_DOMAIN}" "https://${CUSTOM_TEMPLATE_SSL_DOMAIN}:443/"
|
||||
@@ -84,9 +85,23 @@ teardown() {
|
||||
|
||||
@test "(nginx-vhosts) nginx:build-config (custom nginx template - no ssl)" {
|
||||
add_domain "www.test.app.dokku.me"
|
||||
deploy_app nodejs-express dokku@dokku.me:$TEST_APP custom_nginx_template
|
||||
run deploy_app nodejs-express dokku@dokku.me:$TEST_APP custom_nginx_template
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku ps:scale $TEST_APP worker=1"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
assert_nonssl_domain "www.test.app.dokku.me"
|
||||
assert_http_success "customtemplate.dokku.me"
|
||||
|
||||
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "${TEST_APP}-worker-5000"
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:build-config (failed validate_nginx)" {
|
||||
|
||||
@@ -430,6 +430,14 @@ upstream {{ $.APP }}-{{ \$upstream_port }} {
|
||||
server {{ \$listener_ip }}:{{ \$upstream_port }};{{ end }}
|
||||
}
|
||||
{{ end }}{{ end }}
|
||||
{{ if $.DOKKU_APP_WORKER_LISTENERS }}
|
||||
{{ range \$upstream_port := $.PROXY_UPSTREAM_PORTS | split " " }}
|
||||
upstream {{ $.APP }}-worker-{{ \$upstream_port }} {
|
||||
{{ range \$listeners := $.DOKKU_APP_WORKER_LISTENERS | split " " }}
|
||||
server {{ \$listeners }};{{ end }}
|
||||
}
|
||||
{{ end }}{{ end }}
|
||||
|
||||
EOF
|
||||
cat "$APP_REPO_DIR/nginx.conf.sigil"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user