forked from altlinuxteam/alt-packer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
46 lines (42 loc) · 1.11 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
PACKER_CACHE_DIR := ./packer_cache
arch = x86_64
BASE_VERSION = 8.2
headless = true
TARGET_VERSION := 8.2
target = alt-server
THIS_FILE := $(lastword $(MAKEFILE_LIST))
# VM_TYPE may be
# - qemu
# - vbox
# - onebula
VM_TYPE := qemu
# on-error may be:
# - abort - stop and leave everything "as is"
# - cleanup - is the default behavior
# - ask - ask what to do
onerror = cleanup
organization = BaseALT
# Build base VM box using Packer
image:
PACKER_CACHE_DIR="$(PACKER_CACHE_DIR)" \
PACKER_TARGET="$(target)" \
PACKER_BASE_VERSION="$(BASE_VERSION)" \
PACKER_ARCH="$(arch)" \
PACKER_HEADLESS="$(headless)" \
PACKER_LOG=1 \
PACKER_TARGET_VERSION="$(TARGET_VERSION)" \
PACKER_VM_TYPE="$(VM_TYPE)" \
./build_vm
# Publish previously built VM box using Vagrant. Please note that you'll
# need to provide TOKEN from Vagrant Cloud as environment variable.
publish:
target="$(target)" \
arch="$(arch)" \
BASE_VERSION="$(BASE_VERSION)" \
TARGET_VERSION="$(TARGET_VERSION)" \
VM_TYPE="$(VM_TYPE)" \
./publish_vm
# Download images specified in JSON configuration files.
sync:
PACKER_CACHE_DIR="$(PACKER_CACHE_DIR)" \
./sync_images