Skip to content

Commit

Permalink
chore: add test distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinkim committed Apr 25, 2018
1 parent 0c5e4cf commit e8160fc
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ ROLE_NAME=franklinkim.apache2
ROLE_PATH=/etc/ansible/roles/$(ROLE_NAME)
TEST_VERSION=ansible --version
TEST_DEPS=ansible-galaxy install weareinteractive.apt franklinkim.openssl franklinkim.htpasswd
TEST_SYNTAX=ansible-playbook -vv -i 'localhost,' -c local $(ROLE_PATH)/tests/main.yml --syntax-check
TEST_PLAYBOOK=ansible-playbook -vv -i 'localhost,' -c local $(ROLE_PATH)/tests/main.yml
TEST_SYNTAX=ansible-playbook -v -i 'localhost,' -c local $(ROLE_PATH)/tests/main.yml --syntax-check
TEST_PLAYBOOK=ansible-playbook -vvvv -i 'localhost,' -c local $(ROLE_PATH)/tests/main.yml
TEST_CMD=$(TEST_DEPS); $(TEST_VERSION); $(TEST_SYNTAX); $(TEST_PLAYBOOK)

.PHONY: test

test_ubuntu16.06: dist=ubuntu16.06
test_ubuntu16.06: test

test_ubuntu14.06: dist=ubuntu14.06
test_ubuntu14.06: test

test_debian9: dist=debian9
test_debian9: test

test_debian8: dist=debian8
test_debian8: test

test:
docker run -it --rm -e "ROLE_NAME=$(ROLE_NAME)" -v $(PWD):$(ROLE_PATH) williamyeh/ansible:ubuntu16.04 /bin/bash -c "$(TEST_CMD)"
docker run -it --rm -v $(PWD):$(ROLE_PATH) williamyeh/ansible:$(dist) /bin/bash -c "$(TEST_CMD)"

0 comments on commit e8160fc

Please sign in to comment.