Compare commits
15 Commits
remove-pus
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
465f46ad48 | ||
|
|
f6aed2c86a | ||
|
|
88716ad3ff | ||
|
|
16ee2f3ddc | ||
|
|
5b3e196267 | ||
|
|
4bf9d45797 | ||
|
|
91b77b3d31 | ||
|
|
66b436219f | ||
|
|
ba2827a8fe | ||
|
|
4de5558b63 | ||
|
|
71ff227953 | ||
|
|
64304160b9 | ||
|
|
bce675fbd2 | ||
|
|
1532f30641 | ||
|
|
cf41f2e776 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.gitlab
|
||||||
5
Makefile
5
Makefile
@@ -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)
|
||||||
|
|||||||
@@ -1,29 +1,37 @@
|
|||||||
.PHONY: docker-init
|
.PHONY: docker-init
|
||||||
docker-init:
|
docker-init:
|
||||||
@touch VERSION
|
@echo "0.0.1" >> VERSION
|
||||||
@touch IMAGE
|
@echo "$(PROJECT_NAME)" >> 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
|
.PHONY: docker-compose-init
|
||||||
docker-release:
|
docker-compose-init:
|
||||||
@yq e ".services.minecraft.image = \"$(IMAGE)\"" -i docker-compose.yaml
|
@touch docker-compose.yaml
|
||||||
@make push
|
@yq e ".version = \"3\"" -i docker-compose.yaml
|
||||||
|
@yq e ".services.main.image = \"$(IMAGE)\"" -i docker-compose.yaml
|
||||||
|
|
||||||
|
.PHONY: docker-compose-up
|
||||||
|
docker-compose-up:
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
.PHONY: docker-compose-down
|
||||||
|
docker-compose-down:
|
||||||
|
docker-compose down
|
||||||
|
|||||||
@@ -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
make/kubectl.makefile
Normal file
11
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