First pass at a dockerized toolchain.

I've seen a lot more failures. Compose is not the latest. It seems to
sort of work. We should probably parameterize Docker and Compose
versions to ensure we're installing a consistent toolchain.

Signed-off-by: Chad Metcalf <chad@docker.com>
This commit is contained in:
Chad Metcalf
2020-08-11 09:20:46 -07:00
parent 199da87b3b
commit 3d1fb4c9a4
3 changed files with 47 additions and 1 deletions

View File

@@ -1,8 +1,10 @@
.phony: test-all test-changed update-tests
BASE_REF ?= origin/master
UID := $(shell id -u)
GID := $(shell grep docker /etc/group| cut -d: -f3)
all: test-changed
all: docker-test-changed
test-all:
@bats -T $(shell find . -name test.bats| sort )
@@ -12,3 +14,15 @@ test-changed:
update-tests:
@find . -maxdepth 1 -type d -not -path '*/\.*' -not -path '.' -not -path './lib' -exec cp ./lib/test.bats.example {}/test.bats \;
docker:
@docker build --build-arg=UID=${UID} --build-arg=GID=${GID} -t awesome-compose ./extras
docker-test-all: docker
@docker run --rm -it --network=host -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/code awesome-compose -c "make test-all"
docker-test-changed: docker
@docker run --rm -it --network=host -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/code awesome-compose -c "make test-changed"
shell: docker
@docker run --rm -it --network=host -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/code awesome-compose