control agent can now uboot commands
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
# Should be the same as upstream version in production
|
||||
VERSION ?= dev
|
||||
UBOOT_VERSION=v2026.01
|
||||
|
||||
# Target kube version
|
||||
KUBE_VERSION ?= v1.35.0
|
||||
|
||||
GIT_REV := $(shell git rev-parse HEAD)
|
||||
|
||||
BIN_DIR := bin
|
||||
OUT_DIR := out
|
||||
PACKAGES_DIR := packages
|
||||
BIN_DIR := bin
|
||||
OUT_DIR := out
|
||||
|
||||
UBOOT_TAR := $(PACKAGES_DIR)/uboot-$(UBOOT_VERSION).tar.gz
|
||||
|
||||
BUILDINFO_FILE := pkg/buildinfo/buildinfo_gen.go
|
||||
CRD_PATHS := ./pkg/apis/...
|
||||
|
||||
$(PACKAGES_DIR):
|
||||
mkdir -p $@
|
||||
|
||||
# Never cache this
|
||||
.buildinfo:
|
||||
@mkdir -p $(dir $(BUILDINFO_FILE))
|
||||
@@ -26,13 +33,27 @@ CRD_PATHS := ./pkg/apis/...
|
||||
')' \
|
||||
> $(BUILDINFO_FILE)
|
||||
|
||||
$(UBOOT_TAR): | $(PACKAGES_DIR)
|
||||
git clone --depth 1 --branch v2026.01 --filter=blob:none https://github.com/u-boot/u-boot.git $(OUT_DIR)/u-boot-$(UBOOT_VERSION)
|
||||
tar -C "$(OUT_DIR)/u-boot-$(UBOOT_VERSION)" -zcf "$@" .
|
||||
rm -rf $(OUT_DIR)/u-boot-$(UBOOT_VERSION)
|
||||
test -f $@
|
||||
|
||||
uboot-tools: $(UBOOT_TAR)
|
||||
docker buildx build --platform linux/arm64 \
|
||||
-f docker/uboot-tools.Dockerfile \
|
||||
--build-arg UBOOT_VERSION=$(UBOOT_VERSION) \
|
||||
--build-arg UBOOT_TAR=$(UBOOT_TAR) \
|
||||
--output type=local,dest=./$(OUT_DIR) .
|
||||
|
||||
build: .buildinfo
|
||||
mkdir -p $(BIN_DIR) $(OUT_DIR)/crds
|
||||
controller-gen crd paths=$(CRD_PATHS) output:crd:dir=$(OUT_DIR)/crds
|
||||
GOOS=linux GOARCH=arm64 go build -o $(BIN_DIR)/ctl-linux-aarch64-$(VERSION) ./cmd/ctl
|
||||
|
||||
build-agent: build
|
||||
build-agent: build uboot-tools
|
||||
docker build \
|
||||
-f docker/ctl-agent.Dockerfile \
|
||||
--platform=linux/arm64 \
|
||||
--build-arg VERSION=$(VERSION) \
|
||||
-t localhost/monok8s/control-agent:$(VERSION) .
|
||||
@@ -52,4 +73,4 @@ clean:
|
||||
|
||||
all: build build-agent build-local
|
||||
|
||||
.PHONY: clean all run .buildinfo build build-local build-agent
|
||||
.PHONY: clean all run .buildinfo build build-local build-agent uboot-tools
|
||||
|
||||
Reference in New Issue
Block a user