-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile
48 lines (40 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
48
SHELL=/bin/bash
PACKER=packer
export CHECKPOINT_DISABLE := 1
export PACKER_CACHE_DIR := \
$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/.packer/cache
export VERSION := $(shell date -u +%Y%m%d%H%M)
EXECUTABLES = $(PACKER) ansible
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
WHICH-%: ; @which $* > /dev/null
all: clean WHICH-qemu-system-x86_64
$(PACKER) build --parallel=false packer/build.json
clean:
mkdir -p dist
rm -rf dist/*
rm -rf .packer/build
docker:
mkdir -p dist
rm -rf dist/*docker*
rm -rf .packer/build/docker
$(PACKER) build -only docker packer/build.json
qemu: WHICH-qemu-system-x86_64
mkdir -p dist
rm -rf dist/*qemu*
rm -rf .packer/build/qemu
$(PACKER) build -only qemu packer/build.json
vagrant:
mkdir -p dist
rm -rf dist/*vagrant*
rm -rf dist/*virtualbox*
rm -rf .packer/build/virtualbox
$(PACKER) build -only virtualbox packer/build.json
lxc:
mkdir -p dist
rm -rf dist/*lxc*
rm -rf .packer/build/lxc
$(PACKER) build -only lxc packer/build.json
release:
bash scripts/release.sh
.PHONY: all docker qemu vagrant lxc clean