-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (59 loc) · 2.19 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
BACKEND?=dockerv3
CONCURRENCY?=1
# Abs path only. It gets copied in chroot in pre-seed stages
LUET?=/usr/bin/luet-build
export ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
DESTINATION?=$(ROOT_DIR)/output
COMPRESSION?=zstd
CLEAN?=true
TREE?=./packages
BUILD_ARGS?= --pull --image-repository quay.io/geaaru/mottainairepo-amd64-cache --only-target-package
GENIDX_ARGS?=--only-upper-level --compress=false
CONFIG?= --config conf/luet.yaml
export LUET_BIN?=$(LUET)
.PHONY: all
all: build
.PHONY: clean
clean:
rm -rf build/ *.tar *.metadata.yaml
.PHONY: build
build: clean
mkdir -p $(ROOT_DIR)/build
$(LUET) build $(BUILD_ARGS) $(CONFIG) --tree=$(TREE) $(PACKAGES) --destination $(ROOT_DIR)/build --backend $(BACKEND) --concurrency $(CONCURRENCY) --compression $(COMPRESSION)
.PHONY: build-all
build-all: clean
mkdir -p $(ROOT_DIR)/build
$(LUET) build $(BUILD_ARGS) $(CONFIG) --tree=$(TREE) --all --destination $(ROOT_DIR)/build --backend $(BACKEND) --concurrency $(CONCURRENCY) --compression $(COMPRESSION)
rm -rf $(ROOT_DIR)/build/*.image.tar
.PHONY: rebuild
rebuild:
$(LUET) build $(BUILD_ARGS) $(CONFIG) --tree=$(TREE) $(PACKAGES) --destination $(ROOT_DIR)/build --backend $(BACKEND) --concurrency $(CONCURRENCY) --compression $(COMPRESSION)
.PHONY: rebuild-all
rebuild-all:
$(LUET) build $(BUILD_ARGS) $(CONFIG) --tree=$(TREE) --all --destination $(ROOT_DIR)/build --backend $(BACKEND) --concurrency $(CONCURRENCY) --compression $(COMPRESSION)
.PHONY: genidx
genidx:
$(SUDO) $(LUET) tree genidx $(GENIDX_ARGS) --tree=$(TREE)
.PHONY: create-repo
create-repo: genidx
$(LUET) create-repo $(CONFIG) --tree "$(TREE)" \
--output $(ROOT_DIR)/build \
--packages $(ROOT_DIR)/build \
--name "mottainai-stable" \
--descr "MottainaiCI Official Repository" \
--urls "http://localhost:8000" \
--tree-compression $(COMPRESSION) \
--tree-filename tree.tar.zst \
--with-compilertree \
--type http
.PHONY: serve-repo
serve-repo:
LUET_NOLOCK=true $(LUET) serve-repo --port 8000 --dir $(ROOT_DIR)/build
.PHONY: autobump
autobump:
TREE_DIR=$(ROOT_DIR) $(LUET) autobump-github
.PHONY: auto-bump
auto-bump: autobump
.PHONY: validate
validate:
$(LUET) tree validate -t ${TREE}