-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
52 lines (40 loc) · 1.22 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
48
49
50
51
52
export ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
export ISO?=$(ROOT_DIR)/$(shell ls *.iso)
deps:
ifneq ($(shell id -u), 0)
@echo "You must be root to perform this action."
exit 1
endif
curl https://get.mocaccino.org/luet/get_luet_root.sh | sh
luet install -y repository/mocaccino-extra-stable
luet install -y utils/jq utils/yq system/luet-devkit
# QEMU
$(ROOT_DIR)/.qemu:
mkdir -p $(ROOT_DIR)/.qemu
$(ROOT_DIR)/.qemu/drive.img: $(ROOT_DIR)/.qemu
qemu-img create -f qcow2 $(ROOT_DIR)/.qemu/drive.img 16g
run-qemu: $(ROOT_DIR)/.qemu/drive.img
$(QEMU) \
-m $(QEMU_MEMORY) \
-cdrom $(ISO) \
-nographic \
-serial mon:stdio \
-rtc base=utc,clock=rt \
-chardev socket,path=$(ROOT_DIR)/.qemu/qga.sock,server,nowait,id=qga0 \
-device virtio-serial \
-hda $(ROOT_DIR)/.qemu/drive.img $(QEMU_ARGS)
# Packer
.PHONY: packer
packer:
cd $(ROOT_DIR)/packer && packer build -var "iso=$(ISO)" $(PACKER_ARGS) images.json
# Tests
prepare-test:
vagrant box add mocaccino packer/*.box
vagrant up || true
Vagrantfile:
vagrant init mocaccino
test-clean:
vagrant destroy || true
vagrant box remove mocaccino || true
test: test-clean Vagrantfile prepare-test
cd $(ROOT_DIR)/tests && ginkgo -timeout 30m -r ./...