forked from dduportal/alpine2docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (27 loc) · 879 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
BOX_VERSION := 1.5.0
BOX_NAME := alpine2docker
BOX_FILE := $(BOX_NAME)-$(BOX_VERSION).box
BOX_TEST := $(BOX_NAME)-test
TEST_DIR := ./tests
all: clean box prepare-test test hashes
clean: clean-test clean-box
box: $(BOX_FILE)
$(BOX_FILE):
packer build -var 'BOX_VERSION=$(BOX_VERSION)' $(BOX_NAME).json
prepare-test:
vagrant box add --force $(BOX_TEST) $(BOX_FILE)
cd $(TEST_DIR) && vagrant init -f -m $(BOX_TEST)
test:
cd $(TEST_DIR) && bats ./*.bats
clean-test:
cd $(TEST_DIR) && vagrant destroy -f || true
cd $(TEST_DIR) && rm -rf Vagrantfile .vagrant
vagrant box remove $(BOX_TEST) || true
vagrant global-status --prune
clean-box:
rm -rf output* $(BOX_FILE)
rm -rf "$(HOME)/VirtualBox VMs/$(BOX_NAME)"
hashes:
shasum -a 256 $(BOX_NAME)-$(BOX_VERSION).box
shasum $(BOX_NAME)-$(BOX_VERSION).box
.PHONY: box prepare-test test all clean clean-test clean-box