mirror of
https://github.com/thib8956/nginx-proxy
synced 2024-11-22 03:46:29 +00:00
Merge pull request #441 from jwilder/jw-0.7.1
Update to docker-gen 0.7.1
This commit is contained in:
commit
e964b9d29f
@ -17,7 +17,7 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
|
|||||||
ADD https://github.com/jwilder/forego/releases/download/v0.16.1/forego /usr/local/bin/forego
|
ADD https://github.com/jwilder/forego/releases/download/v0.16.1/forego /usr/local/bin/forego
|
||||||
RUN chmod u+x /usr/local/bin/forego
|
RUN chmod u+x /usr/local/bin/forego
|
||||||
|
|
||||||
ENV DOCKER_GEN_VERSION 0.7.0
|
ENV DOCKER_GEN_VERSION 0.7.1
|
||||||
|
|
||||||
RUN wget https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
|
RUN wget https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
|
||||||
&& tar -C /usr/local/bin -xvzf docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
|
&& tar -C /usr/local/bin -xvzf docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
|
||||||
|
2
Makefile
2
Makefile
@ -2,7 +2,7 @@
|
|||||||
.PHONY : test
|
.PHONY : test
|
||||||
|
|
||||||
update-dependencies:
|
update-dependencies:
|
||||||
docker pull jwilder/docker-gen:0.7.0
|
docker pull jwilder/docker-gen:0.7.1
|
||||||
docker pull nginx:1.9.12
|
docker pull nginx:1.9.12
|
||||||
docker pull python:3
|
docker pull python:3
|
||||||
docker pull rancher/socat-docker:latest
|
docker pull rancher/socat-docker:latest
|
||||||
|
@ -11,7 +11,7 @@ load test_helpers
|
|||||||
@test "[$TEST_FILE] -v /var/run/docker.sock:/tmp/docker.sock:ro" {
|
@test "[$TEST_FILE] -v /var/run/docker.sock:/tmp/docker.sock:ro" {
|
||||||
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}-1
|
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}-1
|
||||||
|
|
||||||
# WHEN nginx-proxy runs on our docker host using the default unix socket
|
# WHEN nginx-proxy runs on our docker host using the default unix socket
|
||||||
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/tmp/docker.sock:ro
|
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
assert_success
|
assert_success
|
||||||
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
|
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
|
||||||
@ -24,7 +24,7 @@ load test_helpers
|
|||||||
@test "[$TEST_FILE] -v /var/run/docker.sock:/f00.sock:ro -e DOCKER_HOST=unix:///f00.sock" {
|
@test "[$TEST_FILE] -v /var/run/docker.sock:/f00.sock:ro -e DOCKER_HOST=unix:///f00.sock" {
|
||||||
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}-2
|
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}-2
|
||||||
|
|
||||||
# WHEN nginx-proxy runs on our docker host using a custom unix socket
|
# WHEN nginx-proxy runs on our docker host using a custom unix socket
|
||||||
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/f00.sock:ro -e DOCKER_HOST=unix:///f00.sock
|
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/f00.sock:ro -e DOCKER_HOST=unix:///f00.sock
|
||||||
assert_success
|
assert_success
|
||||||
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
|
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
|
||||||
@ -45,7 +45,7 @@ load test_helpers
|
|||||||
run nginxproxy $SUT_CONTAINER -e DOCKER_HOST="tcp://bats-docker-tcp:2375" --link bats-docker-tcp:bats-docker-tcp
|
run nginxproxy $SUT_CONTAINER -e DOCKER_HOST="tcp://bats-docker-tcp:2375" --link bats-docker-tcp:bats-docker-tcp
|
||||||
assert_success
|
assert_success
|
||||||
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
|
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
|
||||||
|
|
||||||
# THEN
|
# THEN
|
||||||
assert_nginxproxy_behaves $SUT_CONTAINER
|
assert_nginxproxy_behaves $SUT_CONTAINER
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ load test_helpers
|
|||||||
-v $BATS_TEST_DIRNAME/../nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro \
|
-v $BATS_TEST_DIRNAME/../nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro \
|
||||||
--volumes-from bats-nginx \
|
--volumes-from bats-nginx \
|
||||||
--expose 80 \
|
--expose 80 \
|
||||||
jwilder/docker-gen:0.7.0 \
|
jwilder/docker-gen:0.7.1 \
|
||||||
-notify-sighup bats-nginx \
|
-notify-sighup bats-nginx \
|
||||||
-watch \
|
-watch \
|
||||||
-only-exposed \
|
-only-exposed \
|
||||||
@ -82,8 +82,8 @@ load test_helpers
|
|||||||
/etc/nginx/conf.d/default.conf
|
/etc/nginx/conf.d/default.conf
|
||||||
assert_success
|
assert_success
|
||||||
docker_wait_for_log bats-docker-gen 9 "Watching docker events"
|
docker_wait_for_log bats-docker-gen 9 "Watching docker events"
|
||||||
|
|
||||||
# Give some time to the docker-gen container to notify bats-nginx so it
|
# Give some time to the docker-gen container to notify bats-nginx so it
|
||||||
# reloads its config
|
# reloads its config
|
||||||
sleep 2s
|
sleep 2s
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ function assert_nginxproxy_behaves {
|
|||||||
|
|
||||||
run curl_container $container /data --header "Host: web2.bats"
|
run curl_container $container /data --header "Host: web2.bats"
|
||||||
assert_output "answer from port 82"
|
assert_output "answer from port 82"
|
||||||
|
|
||||||
# Querying the proxy with unknown Host header → 503
|
# Querying the proxy with unknown Host header → 503
|
||||||
run curl_container $container /data --header "Host: webFOO.bats" --head
|
run curl_container $container /data --header "Host: webFOO.bats" --head
|
||||||
assert_output -l 0 $'HTTP/1.1 503 Service Temporarily Unavailable\r'
|
assert_output -l 0 $'HTTP/1.1 503 Service Temporarily Unavailable\r'
|
||||||
|
Loading…
Reference in New Issue
Block a user