-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
79 lines (63 loc) · 2.3 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
BACKEND?=docker
CONCURRENCY?=1
CI_ARGS?=
PACKAGES?=
# Abs path only. It gets copied in chroot in pre-seed stages
export LUET?=/usr/bin/luet
export ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
DESTINATION?=$(ROOT_DIR)/build
COMPRESSION?=gzip
CLEAN?=false
export TREE?=$(ROOT_DIR)/packages
REPO_CACHE?=quay.io/mocaccinocache/micro-amd64-cache
export REPO_CACHE
BUILD_ARGS?=--pull --no-spinner --config $(ROOT_DIR)/conf/luet.yaml
SUDO?=
VALIDATE_OPTIONS?=-s
ARCH?=amd64
ifneq ($(strip $(REPO_CACHE)),)
BUILD_ARGS+=--image-repository $(REPO_CACHE)
endif
.PHONY: all
all: deps build
.PHONY: deps
deps:
@echo "Installing luet"
go get -u github.com/mudler/luet
.PHONY: clean
clean:
$(SUDO) rm -rf build/ *.tar *.metadata.yaml
.PHONY: build
build: clean
mkdir -p $(DESTINATION)
$(SUDO) $(LUET) build $(BUILD_ARGS) --values arches/$(ARCH)/values.yaml --tree=$(TREE) $(PACKAGES) --destination $(DESTINATION) --backend $(BACKEND) --concurrency $(CONCURRENCY) --compression $(COMPRESSION)
.PHONY: build-all
build-all: clean
mkdir -p $(DESTINATION)
$(SUDO) $(LUET) build $(BUILD_ARGS) --values arches/$(ARCH)/values.yaml --tree=$(TREE) --full --destination $(DESTINATION) --backend $(BACKEND) --concurrency $(CONCURRENCY) --compression $(COMPRESSION)
.PHONY: rebuild
rebuild:
$(SUDO) $(LUET) build $(BUILD_ARGS) --values arches/$(ARCH)/values.yaml --tree=$(TREE) $(PACKAGES) --destination $(DESTINATION) --backend $(BACKEND) --concurrency $(CONCURRENCY) --compression $(COMPRESSION)
.PHONY: rebuild-all
rebuild-all:
$(SUDO) $(LUET) build $(BUILD_ARGS) --values arches/$(ARCH)/values.yaml --tree=$(TREE) --full --destination $(DESTINATION) --backend $(BACKEND) --concurrency $(CONCURRENCY) --compression $(COMPRESSION)
.PHONY: create-repo
create-repo:
$(SUDO) $(LUET) create-repo --tree "$(TREE)" \
--output $(DESTINATION) \
--packages $(DESTINATION) \
--name "mocaccino-micro" \
--descr "Mocaccino Micro $(ARCH)" \
--urls "http://localhost:8000" \
--tree-compression gzip \
--tree-filename tree.tar \
--meta-compression gzip \
--type http
.PHONY: serve-repo
serve-repo:
LUET_NOLOCK=true $(LUET) serve-repo --port 8000 --dir $(DESTINATION)
auto-bump:
TREE_DIR=$(ROOT_DIR) $(LUET) autobump-github
autobump: auto-bump
validate:
$(LUET) tree validate --tree $(TREE) $(VALIDATE_OPTIONS)