.PHONY: test shellcheck docopt kcov codecov
test_dind:
@sudo DOCKER_CONTEXT=default docker run \
-v $$(pwd):/workdir \
--privileged \
-d \
--name=abra-test-dind \
-e DOCKER_TLS_CERTDIR="" \
docker:dind
@DOCKER_CONTEXT=default docker exec \
-it \
abra-test-dind \
sh -c "apk add bats git bash && cd /workdir && bats /workdir/tests"
@DOCKER_CONTEXT=default docker stop abra-test-dind
@DOCKER_CONTEXT=default docker rm abra-test-dind
test_docker:
@DOCKER_CONTEXT=default docker run \
--rm \
docker:dind \
test_local:
bats tests
shellcheck:
@docker run \
koalaman/shellcheck-alpine \
shellcheck /workdir/abra
docopt:
@if [ ! -d ".venv" ]; then \
python3 -m venv .venv && \
.venv/bin/pip install -U pip setuptools wheel && \
.venv/bin/pip install docopt-sh; \
fi
.venv/bin/docopt.sh abra
kcov:
kcov/kcov:latest \
sh -c "kcov /workdir/coverage /workdir/abra || true"
codecov: SHELL:=/bin/bash
codecov:
@bash <(curl -s https://codecov.io/bash) \
-s coverage -t $$(pass show hosts/swarm.autonomic.zone/drone/codecov/token)