diff --git a/.gitlab/Makefile b/.gitlab/Makefile new file mode 100644 index 0000000..4bcb9cd --- /dev/null +++ b/.gitlab/Makefile @@ -0,0 +1,9 @@ +SHELL := /bin/bash + +IMAGE ?= $(shell cat IMAGE):$(shell cat VERSION) +IMAGE_LATEST ?= $(shell cat IMAGE):latest +PWD ?= $(shell pwd) + +include make/docker.makefile +include make/kaniko.makefile +include make/truenas.makefile diff --git a/.gitlab/make/docker.makefile b/.gitlab/make/docker.makefile new file mode 100644 index 0000000..4af850f --- /dev/null +++ b/.gitlab/make/docker.makefile @@ -0,0 +1,26 @@ +.PHONY: docker-init +docker-init: + @touch VERSION + @touch IMAGE + +.PHONY: buildx-context +buildx-context: + docker buildx create --name arm64 --use --platform linux/amd64,linux/arm64 + +.PHONY: buildx-clear +buildx-clear: + docker buildx rm arm64 + +.PHONY: build +build: + docker buildx build --load . -t $(IMAGE) + @docker buildx build --load . -t $(IMAGE_LATEST) + +.PHONY: push +push: + docker buildx build --platform linux/amd64 --push . -t $(IMAGE) + @docker buildx build --platform linux/amd64 --push . -t $(IMAGE_LATEST) + +.PHONY: run +run: + docker run -it -v $(PWD):/mc_data $(IMAGE) bash diff --git a/.gitlab/make/kaniko.makefile b/.gitlab/make/kaniko.makefile new file mode 100644 index 0000000..e69de29 diff --git a/.gitlab/make/truenas.makefile b/.gitlab/make/truenas.makefile new file mode 100644 index 0000000..e69de29