-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile
112 lines (101 loc) · 4.04 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
SHELL=bash
.SHELLFLAGS=-euo pipefail -c
VAR_FILE :=
VAR_FILE_OPTION := $(addprefix -var-file=,$(VAR_FILE))
help:
@echo type make build-libvirt, make build-uefi-libvirt, make build-proxmox, make build-uefi-proxmox, make build-hyperv, or make build-vsphere
build-libvirt: proxmox-ve-amd64-libvirt.box
build-uefi-libvirt: proxmox-ve-uefi-amd64-libvirt.box
build-proxmox: proxmox-ve-amd64-proxmox.box
build-uefi-proxmox: proxmox-ve-uefi-amd64-proxmox.box
build-hyperv: proxmox-ve-amd64-hyperv.box
build-vsphere: proxmox-ve-amd64-vsphere.box
proxmox-ve-amd64-libvirt.box: provisioners/*.sh proxmox-ve.pkr.hcl Vagrantfile.template $(VAR_FILE)
rm -f $@
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
packer init proxmox-ve.pkr.hcl
PACKER_OUTPUT_BASE_DIR=$${PACKER_OUTPUT_BASE_DIR:-.} \
PACKER_KEY_INTERVAL=10ms \
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
PKR_VAR_vagrant_box=$@ \
packer build -only=qemu.proxmox-ve-amd64 -on-error=abort -timestamp-ui $(VAR_FILE_OPTION) proxmox-ve.pkr.hcl
@./box-metadata.sh libvirt proxmox-ve-amd64 $@
proxmox-ve-uefi-amd64-libvirt.box: provisioners/*.sh proxmox-ve.pkr.hcl Vagrantfile-uefi.template $(VAR_FILE)
rm -f $@
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
packer init proxmox-ve.pkr.hcl
PACKER_OUTPUT_BASE_DIR=$${PACKER_OUTPUT_BASE_DIR:-.} \
PACKER_KEY_INTERVAL=10ms \
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
PKR_VAR_vagrant_box=$@ \
packer build -only=qemu.proxmox-ve-uefi-amd64 -on-error=abort -timestamp-ui $(VAR_FILE_OPTION) proxmox-ve.pkr.hcl
@./box-metadata.sh libvirt proxmox-ve-uefi-amd64 $@
proxmox-ve-amd64-proxmox.box: provisioners/*.sh proxmox-ve.pkr.hcl Vagrantfile.template $(VAR_FILE)
rm -f $@
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
packer init proxmox-ve.pkr.hcl
PACKER_OUTPUT_BASE_DIR=$${PACKER_OUTPUT_BASE_DIR:-.} \
PACKER_KEY_INTERVAL=10ms \
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
PKR_VAR_vagrant_box=$@ \
packer build -only=proxmox-iso.proxmox-ve-amd64 -on-error=abort -timestamp-ui $(VAR_FILE_OPTION) proxmox-ve.pkr.hcl
proxmox-ve-uefi-amd64-proxmox.box: provisioners/*.sh proxmox-ve.pkr.hcl Vagrantfile.template $(VAR_FILE)
rm -f $@
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
packer init proxmox-ve.pkr.hcl
PACKER_OUTPUT_BASE_DIR=$${PACKER_OUTPUT_BASE_DIR:-.} \
PACKER_KEY_INTERVAL=10ms \
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
PKR_VAR_vagrant_box=$@ \
packer build -only=proxmox-iso.proxmox-ve-uefi-amd64 -on-error=abort -timestamp-ui $(VAR_FILE_OPTION) proxmox-ve.pkr.hcl
proxmox-ve-amd64-hyperv.box: provisioners/*.sh proxmox-ve.pkr.hcl Vagrantfile.template $(VAR_FILE)
rm -f $@
mkdir -p tmp
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
packer init proxmox-ve.pkr.hcl
PACKER_OUTPUT_BASE_DIR=$${PACKER_OUTPUT_BASE_DIR:-.} \
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
PKR_VAR_vagrant_box=$@ \
packer build -only=hyperv-iso.proxmox-ve-amd64 -on-error=abort -timestamp-ui $(VAR_FILE_OPTION) proxmox-ve.pkr.hcl
@./box-metadata.sh hyperv proxmox-ve-amd64 $@
proxmox-ve-amd64-vsphere.box: provisioners/*.sh proxmox-ve-vsphere.pkr.hcl $(VAR_FILE)
rm -f $@
mkdir -p tmp
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
packer init proxmox-ve-vsphere.pkr.hcl
PACKER_OUTPUT_BASE_DIR=$${PACKER_OUTPUT_BASE_DIR:-.} \
CHECKPOINT_DISABLE=1 \
PACKER_LOG=1 \
packer build -only=vsphere-iso.proxmox-ve-amd64 -on-error=abort -timestamp-ui $(VAR_FILE_OPTION) proxmox-ve-vsphere.pkr.hcl
rm -rf tmp/$@-contents
mkdir -p tmp/$@-contents
echo '{"provider":"vsphere"}' >tmp/$@-contents/metadata.json
cp Vagrantfile.template tmp/$@-contents/Vagrantfile
tar cvf $@ -C tmp/$@-contents .
@./box-metadata.sh vsphere proxmox-ve-amd64 $@
clean:
rm -rf packer_cache $${PACKER_OUTPUT_BASE_DIR:-.}/output-proxmox-ve*
.PHONY: help build-libvirt build-uefi-libvirt build-proxmox build-uefi-proxmox build-hyperv build-vsphere clean