Merge update from Common
This commit is contained in:
1
.gitlab/.gitignore
vendored
Normal file
1
.gitlab/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.gitlab
|
||||||
@@ -6,13 +6,16 @@ IMAGE ?= $(shell cat IMAGE):$(VERSION)
|
|||||||
IMAGE_LATEST ?= $(shell cat IMAGE):latest
|
IMAGE_LATEST ?= $(shell cat IMAGE):latest
|
||||||
PWD ?= $(shell pwd)
|
PWD ?= $(shell pwd)
|
||||||
STASH ?= "common-update-stash"
|
STASH ?= "common-update-stash"
|
||||||
|
MAKE_BRANCH ?= main
|
||||||
|
|
||||||
include .gitlab/make/docker.makefile
|
include .gitlab/make/docker.makefile
|
||||||
include .gitlab/make/helm.makefile
|
include .gitlab/make/helm.makefile
|
||||||
include .gitlab/make/kaniko.makefile
|
include .gitlab/make/kaniko.makefile
|
||||||
include .gitlab/make/truenas.makefile
|
include .gitlab/make/truenas.makefile
|
||||||
include .gitlab/make/git.makefile
|
include .gitlab/make/git.makefile
|
||||||
|
include .gitlab/make/kubectl.makefile
|
||||||
|
|
||||||
|
# git subtree add --prefix .gitlab --squash --message "Merge update from Common" -q git@gitlab.ducoterra.net:services/common.git main
|
||||||
.PHONY: make-update
|
.PHONY: make-update
|
||||||
make-update:
|
make-update:
|
||||||
@git subtree pull --prefix .gitlab --squash --message "Merge update from Common" -q git@gitlab.ducoterra.net:services/common.git main
|
@git subtree pull --prefix .gitlab --squash --message "Merge update from Common" -q git@gitlab.ducoterra.net:services/common.git $(MAKE_BRANCH)
|
||||||
|
|||||||
@@ -3,27 +3,21 @@ docker-init:
|
|||||||
@touch VERSION
|
@touch VERSION
|
||||||
@touch IMAGE
|
@touch IMAGE
|
||||||
|
|
||||||
.PHONY: buildx-context
|
.PHONY: docker-buildx-context
|
||||||
buildx-context:
|
docker-buildx-context:
|
||||||
docker buildx create --name container-builder --use --platform linux/amd64,linux/arm64
|
@docker buildx create --name container-builder --use --platform linux/amd64,linux/arm64
|
||||||
|
|
||||||
.PHONY: buildx-clear
|
.PHONY: docker-buildx-clear
|
||||||
buildx-clear:
|
docker-buildx-clear:
|
||||||
docker buildx rm container-builder
|
@docker buildx rm container-builder
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: docker-build
|
||||||
build:
|
docker-build:
|
||||||
docker buildx build --load . -t $(IMAGE)
|
docker build . -t $(IMAGE)
|
||||||
@docker buildx build --load . -t $(IMAGE_LATEST)
|
|
||||||
|
|
||||||
.PHONY: push
|
.PHONY: docker-push
|
||||||
push:
|
docker-push:
|
||||||
-make buildx-clear
|
-make docker-buildx-clear
|
||||||
@make buildx-context
|
@make docker-buildx-context
|
||||||
docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE)
|
docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE)
|
||||||
@docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE_LATEST)
|
@docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE_LATEST)
|
||||||
|
|
||||||
.PHONY: docker-release
|
|
||||||
docker-release:
|
|
||||||
@yq e ".services.minecraft.image = \"$(IMAGE)\"" -i docker-compose.yaml
|
|
||||||
@make push
|
|
||||||
|
|||||||
@@ -2,3 +2,15 @@
|
|||||||
helm-release:
|
helm-release:
|
||||||
@yq e ".version = \"$(shell cat VERSION)\"" -i helm/Chart.yaml
|
@yq e ".version = \"$(shell cat VERSION)\"" -i helm/Chart.yaml
|
||||||
@yq e ".appVersion = \"$(shell cat VERSION)\"" -i helm/Chart.yaml
|
@yq e ".appVersion = \"$(shell cat VERSION)\"" -i helm/Chart.yaml
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install: set-namespace
|
||||||
|
helm install $(PROJECT_NAME) ./helm --set image=$(IMAGE)
|
||||||
|
|
||||||
|
.PHONY: upgrade
|
||||||
|
upgrade: set-namespace
|
||||||
|
helm upgrade $(PROJECT_NAME) ./helm --set image=$(IMAGE)
|
||||||
|
|
||||||
|
.PHONY: uninstall
|
||||||
|
uninstall: set-namespace
|
||||||
|
helm uninstall $(PROJECT_NAME)
|
||||||
|
|||||||
11
.gitlab/make/kubectl.makefile
Normal file
11
.gitlab/make/kubectl.makefile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
.PHONY: set-namespace
|
||||||
|
set-namespace:
|
||||||
|
kubectl config set contexts.$(shell kubectl config current-context).namespace $(shell cat NAMESPACE)
|
||||||
|
|
||||||
|
.PHONY: create-regcred
|
||||||
|
create-regcred:
|
||||||
|
@kubectl create secret docker-registry regcred \
|
||||||
|
--docker-server=registry.ducoterra.net \
|
||||||
|
--docker-username=$(shell vault kv get -field username secret/duconet/basic-auth) \
|
||||||
|
--docker-password='$(shell vault kv get -field password secret/duconet/basic-auth)' \
|
||||||
|
--docker-email=$(shell vault kv get -field username secret/duconet/basic-auth)
|
||||||
Reference in New Issue
Block a user