mirror of
https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion
synced 2024-11-23 09:12:15 +01:00
Run test containers on boulder network
In preparation for upcoming permissions and account_keys test units
This commit is contained in:
parent
51a48eedf0
commit
2adfddc486
@ -34,8 +34,8 @@ install:
|
||||
|
||||
before_script:
|
||||
- git clone https://github.com/docker-library/official-images.git official-images
|
||||
- test/setup/setup-nginx-proxy.sh
|
||||
- test/setup/setup-boulder.sh
|
||||
- test/setup/setup-nginx-proxy.sh
|
||||
- docker pull nginx:alpine
|
||||
|
||||
script:
|
||||
|
@ -198,7 +198,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
## Next thirteen lines were added by jrcs/docker-letsencrypt-nginx-proxy-companion
|
||||
## Next eleven lines were added by jrcs/docker-letsencrypt-nginx-proxy-companion
|
||||
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
self="$(basename "$0")"
|
||||
|
||||
@ -207,8 +207,6 @@ if [[ -z $TRAVIS_CI ]] && [[ -f "$dir/local_test_env.sh" ]]; then
|
||||
source "$dir/local_test_env.sh"
|
||||
fi
|
||||
|
||||
BOULDER_IP="10.77.77.1" && export BOULDER_IP
|
||||
|
||||
# shellcheck source=./tests/test-functions.sh
|
||||
source "$dir/tests/test-functions.sh"
|
||||
## End of additional code
|
||||
|
@ -5,9 +5,6 @@ set -e
|
||||
acme_endpoint='http://boulder:4000/directory'
|
||||
|
||||
setup_boulder() {
|
||||
# Per the boulder README:
|
||||
nginx_proxy_ip="$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' "$NGINX_CONTAINER_NAME")"
|
||||
|
||||
export GOPATH=${TRAVIS_BUILD_DIR}/go
|
||||
[[ ! -d $GOPATH/src/github.com/letsencrypt/boulder ]] \
|
||||
&& git clone --depth=1 https://github.com/letsencrypt/boulder \
|
||||
@ -26,7 +23,7 @@ setup_boulder() {
|
||||
docker-compose run -d \
|
||||
--use-aliases \
|
||||
--name boulder \
|
||||
-e FAKE_DNS=${nginx_proxy_ip:?} \
|
||||
-e FAKE_DNS=10.77.77.1 \
|
||||
--service-ports \
|
||||
boulder
|
||||
popd
|
||||
|
@ -12,6 +12,7 @@ case $SETUP in
|
||||
-v /usr/share/nginx/html \
|
||||
-v /var/run/docker.sock:/tmp/docker.sock:ro \
|
||||
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.test_suite \
|
||||
--network boulder_bluenet \
|
||||
jwilder/nginx-proxy
|
||||
;;
|
||||
|
||||
@ -25,6 +26,7 @@ case $SETUP in
|
||||
-v /etc/nginx/vhost.d \
|
||||
-v /usr/share/nginx/html \
|
||||
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.test_suite \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine
|
||||
|
||||
docker run -d \
|
||||
@ -33,6 +35,7 @@ case $SETUP in
|
||||
-v ${TRAVIS_BUILD_DIR}/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro \
|
||||
-v /var/run/docker.sock:/tmp/docker.sock:ro \
|
||||
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.test_suite \
|
||||
--network boulder_bluenet \
|
||||
jwilder/docker-gen \
|
||||
-notify-sighup $NGINX_CONTAINER_NAME -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
|
||||
;;
|
||||
|
@ -48,6 +48,7 @@ for hosts in "${letsencrypt_hosts[@]}"; do
|
||||
--name "$container" \
|
||||
-e "VIRTUAL_HOST=${TEST_DOMAINS}" \
|
||||
-e "LETSENCRYPT_HOST=${hosts}" \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine > /dev/null && echo "Started test web server for $hosts"
|
||||
|
||||
# Wait for a symlink at /etc/nginx/certs/$base_domain.crt
|
||||
|
@ -32,6 +32,7 @@ for domain in "${domains[@]}"; do
|
||||
--name "$domain" \
|
||||
-e "VIRTUAL_HOST=${domain}" \
|
||||
-e "LETSENCRYPT_HOST=${domain}" \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine > /dev/null && echo "Started test web server for $domain"
|
||||
done
|
||||
|
||||
|
@ -28,6 +28,7 @@ docker run --rm -d \
|
||||
--name "${domains[0]}" \
|
||||
-e "VIRTUAL_HOST=${domains[0]}" \
|
||||
-e "LETSENCRYPT_HOST=${domains[0]}" \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine > /dev/null && echo "Started test web server for ${domains[0]}"
|
||||
|
||||
# Wait for a symlink at /etc/nginx/certs/${domains[0]}.crt
|
||||
|
@ -35,6 +35,7 @@ docker run --rm -d \
|
||||
--name "symlink-le1-le2" \
|
||||
-e "VIRTUAL_HOST=${domains[0]},${domains[1]}" \
|
||||
-e "LETSENCRYPT_HOST=${domains[0]},${domains[1]}" \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine > /dev/null && echo "Started test web server for ${domains[0]},${domains[1]}"
|
||||
|
||||
# ... plus another nginx container for the third domain.
|
||||
@ -42,6 +43,7 @@ docker run --rm -d \
|
||||
--name "symlink-le3" \
|
||||
-e "VIRTUAL_HOST=${domains[2]}" \
|
||||
-e "LETSENCRYPT_HOST=${domains[2]}" \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine > /dev/null && echo "Started test web server for ${domains[2]}"
|
||||
|
||||
# Wait for a file at /etc/nginx/certs/$domain/cert.pem
|
||||
@ -74,6 +76,7 @@ docker run --rm -d \
|
||||
--name "symlink-le1-le2-le3" \
|
||||
-e "VIRTUAL_HOST=${domains[0]},${domains[1]},${domains[2]}" \
|
||||
-e "LETSENCRYPT_HOST=${domains[0]},${domains[1]},${domains[2]}" \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine > /dev/null && echo "Started test web server for ${domains[0]},${domains[1]},${domains[2]}"
|
||||
|
||||
# Check where the symlink points (should be ./le1.wtf/fullchain.pem)
|
||||
@ -92,6 +95,7 @@ docker run --rm -d \
|
||||
--name "symlink-le2" \
|
||||
-e "VIRTUAL_HOST=${domains[1]}" \
|
||||
-e "LETSENCRYPT_HOST=${domains[1]}" \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine > /dev/null && echo "Started test web server for ${domains[1]}"
|
||||
|
||||
# Check where the symlink points (should be ./le2.wtf/fullchain.pem)
|
||||
@ -104,6 +108,7 @@ docker run --rm -d \
|
||||
--name "symlink-lim-le2" \
|
||||
-e "VIRTUAL_HOST=lim.it,${domains[1]}" \
|
||||
-e "LETSENCRYPT_HOST=lim.it,${domains[1]}" \
|
||||
--network boulder_bluenet \
|
||||
nginx:alpine > /dev/null && echo "Started test web server for lim.it,${domains[1]}"
|
||||
|
||||
# The symlink creation for lim.it should time out, and the ${domains[1]}
|
||||
|
@ -25,8 +25,9 @@ function run_le_container {
|
||||
$docker_gen_arg \
|
||||
--env "DHPARAM_BITS=256" \
|
||||
--env "DEBUG=true" \
|
||||
--env "ACME_CA_URI=http://${BOULDER_IP}:4000/directory" \
|
||||
--env "ACME_CA_URI=http://boulder:4000/directory" \
|
||||
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.test_suite \
|
||||
--network boulder_bluenet \
|
||||
"$image" > /dev/null && echo "Started letsencrypt container for test ${name%%_2*}"
|
||||
}
|
||||
export -f run_le_container
|
||||
|
Loading…
Reference in New Issue
Block a user