-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
47 lines (36 loc) · 1.13 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
BRANCH?=$(shell git rev-parse --abbrev-ref HEAD)
all: test clean
watch: test_deps
while sleep 1; do \
find defaults/ handlers/ meta/ tasks/ templates/ tests/vagrant/test.yml \
| entr -d make lint vagrant_up; \
done
test: lint test_deps vagrant_up
integration_test: clean integration_test_deps vagrant_up clean
test_deps:
rm -rf tests/vagrant/sansible.*
ln -s ../.. tests/vagrant/sansible.aws_openvpn
integration_test_deps:
sed -i.bak \
-E 's/(.*)version: (.*)/\1version: origin\/$(BRANCH)/' \
tests/vagrant/integration_requirements.yml
rm -rf tests/vagrant/sansible.*
mv tests/vagrant/integration_requirements.yml.bak tests/vagrant/integration_requirements.yml
vagrant_up:
@cd tests/vagrant; \
if (vagrant status | grep -E "(running|saved|poweroff)" 1>/dev/null) then \
vagrant up || exit 1; \
vagrant provision || exit 1; \
else \
vagrant up || exit 1; \
fi;
vagrant_ssh:
@cd tests/vagrant; \
vagrant up || exit 1; \
vagrant ssh
clean:
rm -rf tests/vagrant/sansible.*
cd tests/vagrant && vagrant destroy
lint:
# find handlers/ meta/ tasks/ -name "*.yml" -type f | xargs grep -E "({{[^ ]|[^ ]}})"
echo "To fix"