-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
24 lines (20 loc) · 996 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
WORKDIR := $(shell pwd)
ARG=debug.yml
.PHONY: build
build:
@export DOCKER_CONTENT_TRUST=0 DOCKER_BUILDKIT=1 && docker image build -t ansible_test .
.PHONY: test
test: build
@export DOCKER_CONTENT_TRUST=0 DOCKER_BUILDKIT=1 && docker container run -it -v ${WORKDIR}:/root ansible_test ansible-playbook -i inventory/inventory.ini -c local localhost.yml
.PHONY: debug
debug: build
@export DOCKER_CONTENT_TRUST=0 DOCKER_BUILDKIT=1 && docker container run -it -v ${WORKDIR}:/root ansible_test ansible-playbook -i inventory/inventory.ini -c local debug.yml
.PHONY: ci
ci: build
@-export DOCKER_CONTENT_TRUST=0 DOCKER_BUILDKIT=1
@-echo "==== yamllint ====\n"
@-docker container run -it -v ${WORKDIR}:/root ansible_test yamllint ${ARG}
@-echo "==== syntax-check ====\n"
@-docker container run -it -v ${WORKDIR}:/root ansible_test ansible-playbook --syntax-check -vv ${ARG}
@-echo "==== ansible-lint ====\n"
@-docker container run -it -v ${WORKDIR}:/root ansible_test ansible-lint -vv ${ARG}