Rework the proxy Makefile to download docker-compose automagically for the build

This commit is contained in:
R. Tyler Croy 2017-12-21 07:07:27 -08:00
parent 9689dbd4df
commit ae0afa226a
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 23 additions and 13 deletions

View File

@ -1,26 +1,36 @@
IMAGE_NAME=codevalet/proxy
COMPOSE=build/docker-compose
all: check
check: bats container
docker-compose up --remove-orphans -d
check: bats container $(COMPOSE)
$(COMPOSE) up --remove-orphans -d
./test/check-connectivity
./bats/bin/bats test/*.bats
bats:
git clone --depth 1 -b v0.4.0 https://github.com/sstephenson/bats.git
container: Dockerfile nginx.conf supervisord.conf
docker build -t $(IMAGE_NAME):latest .
# Whenever the nginx.conf changes, we should down the docker-compose bits just
# to ensure we come up with something new
nginx.conf:
docker-compose down
clean:
docker-compose down
clean: $(COMPOSE)
$(COMPOSE) down
docker rmi $(shell docker images -q -f "reference=$(IMAGE_NAME)")
rm -rf bats
rm -rf build
.PHONY: all check container clean ensure-down
bats:
git clone --depth 1 -b v0.4.0 https://github.com/sstephenson/bats.git
# Whenever the nginx.conf changes, we should down the docker-compose bits just
# to ensure we come up with something new
nginx.conf: $(COMPOSE)
$(COMPOSE) down
build:
mkdir -p build
build/docker-compose: build
(cd build && \
curl -sL https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o docker-compose && \
chmod +x docker-compose)
.PHONY: all check container clean