forked from cilium/packer-ci-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 937 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
DISTRIBUTION ?= ubuntu
JQ ?= del(."post-processors"[])
PACKER ?= packer
ifeq ($(DISTRIBUTION), ubuntu)
JSON_FILE = cilium-ubuntu.json
BOX_FILE = cilium-ginkgo-virtualbox-iso.box
else ifeq ($(DISTRIBUTION), opensuse)
JSON_FILE = cilium-opensuse.json
BOX_FILE = cilium-ginkgo-opensuse-virtualbox-iso.box
else ifeq ($(DISTRIBUTION), ubuntu-next)
JSON_FILE = cilium-ubuntu-next.json
BOX_FILE = cilium-ginkgo-virtualbox-iso-next.box
else
$(error "Distribution $(DISTRIBUTION) is unsupported")
endif
all: build
build: clean fetch-opensuse-ovf validate
jq '$(JQ)' $(JSON_FILE) | $(PACKER) build $(ARGS) -
validate:
jq '$(JQ)' $(JSON_FILE) | $(PACKER) validate -
clean:
rm -Rf $(BOX_FILE) tmp packer_cache packer-*
fetch-opensuse-ovf:
ifeq ($(DISTRIBUTION), opensuse)
./tools/download-opensuse-ovf.sh
endif
install:
vagrant box add --force cilium/$(DISTRIBUTION) $(BOX_FILE)
.PHONY = build validate clean fetch-opensuse-ovf install