Skip to content

Add support for Makefile parameterisation #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
NGINX_PLUS_VERSION=19-1
NGINX_IMAGE=nginxplus:$(NGINX_PLUS_VERSION)
DOCKER_NETWORK?=test
DOCKER_NGINX_PLUS?=nginx-plus
DOCKER_NGINX_PLUS_HELPER?=nginx-plus-helper

test: docker-build run-nginx-plus test-run configure-no-stream-block test-run-no-stream-block clean

Expand All @@ -10,24 +13,24 @@ docker-build:
docker build --build-arg NGINX_PLUS_VERSION=$(NGINX_PLUS_VERSION)~stretch -t $(NGINX_IMAGE) docker

run-nginx-plus:
docker network create --driver bridge test
docker run --network=test -d --name nginx-plus --network-alias=nginx-plus-test --rm -p 8080:8080 -p 8081:8081 $(NGINX_IMAGE)
docker run --network=test -d --name nginx-plus-helper --network-alias=nginx-plus-test --rm -p 8090:8080 -p 8091:8081 $(NGINX_IMAGE)
docker network create --driver bridge $(DOCKER_NETWORK)
docker run --network=$(DOCKER_NETWORK) -d --name $(DOCKER_NGINX_PLUS) --network-alias=nginx-plus-test --rm -p 8080:8080 -p 8081:8081 $(NGINX_IMAGE)
docker run --network=$(DOCKER_NETWORK) -d --name $(DOCKER_NGINX_PLUS_HELPER) --network-alias=nginx-plus-test --rm -p 8090:8080 -p 8091:8081 $(NGINX_IMAGE)

test-run:
go test client/*
go clean -testcache
go test tests/client_test.go
go test tests/client_test.go

configure-no-stream-block:
docker cp docker/nginx_no_stream.conf nginx-plus:/etc/nginx/nginx.conf
docker exec nginx-plus nginx -s reload
docker cp docker/nginx_no_stream.conf $(DOCKER_NGINX_PLUS):/etc/nginx/nginx.conf
docker exec $(DOCKER_NGINX_PLUS) nginx -s reload

test-run-no-stream-block:
go clean -testcache
go test tests/client_no_stream_test.go

clean:
-docker kill nginx-plus
-docker kill nginx-plus-helper
-docker network rm test
-docker kill $(DOCKER_NGINX_PLUS)
-docker kill $(DOCKER_NGINX_PLUS_HELPER)
-docker network rm $(DOCKER_NETWORK)