Add '.gitlab/' from commit '731ada6a3d65b2347ccf204cfe09ee278a4f0594'
git-subtree-dir: .gitlab git-subtree-mainline:422f4d49bdgit-subtree-split:731ada6a3d
This commit is contained in:
34
.gitlab/Makefile
Normal file
34
.gitlab/Makefile
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
SHELL := /bin/bash
|
||||||
|
|
||||||
|
PROJECT_NAME ?= $(shell git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p')
|
||||||
|
VERSION ?= $(shell cat VERSION)
|
||||||
|
IMAGE ?= $(shell cat IMAGE):$(VERSION)
|
||||||
|
IMAGE_LATEST ?= $(shell cat IMAGE):latest
|
||||||
|
PWD ?= $(shell pwd)
|
||||||
|
STASH ?= "common-update-stash"
|
||||||
|
|
||||||
|
include .gitlab/make/docker.makefile
|
||||||
|
include .gitlab/make/helm.makefile
|
||||||
|
include .gitlab/make/kaniko.makefile
|
||||||
|
include .gitlab/make/truenas.makefile
|
||||||
|
include .gitlab/make/git.makefile
|
||||||
|
|
||||||
|
.PHONY: warning
|
||||||
|
warning:
|
||||||
|
@printf "Running a potentially destructive command. If a conflict occurs, fix the conflict and re-run the command.\n"
|
||||||
|
@printf "Cancel with ctrl + c within 3 seconds."
|
||||||
|
@sleep 3
|
||||||
|
|
||||||
|
.PHONY: make-stash-drop
|
||||||
|
make-stash-drop:
|
||||||
|
@if [ ! -z "$$(git stash list | grep -r 'stash@{0}.*common')" ]; then git stash drop; fi
|
||||||
|
|
||||||
|
.PHONY: make-update
|
||||||
|
make-update:
|
||||||
|
@git subtree pull --prefix .gitlab --message "Merge update from Common" -q common main
|
||||||
|
|
||||||
|
.PHONY: make-push
|
||||||
|
make-push: warning
|
||||||
|
@make make-update
|
||||||
|
@git subtree split --branch common/$(PROJECT_NAME) --prefix .gitlab
|
||||||
|
@git push common common/$(PROJECT_NAME):common/$(PROJECT_NAME)
|
||||||
10
.gitlab/README.md
Normal file
10
.gitlab/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Adding the "common" subtree as your .gitlab folder
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Add the subtree as a remote
|
||||||
|
git remote add common git@gitlab.ducoterra.net:services/common.git
|
||||||
|
git subtree add --prefix .gitlab common main
|
||||||
|
|
||||||
|
# Now you can run the following to update
|
||||||
|
make make-update
|
||||||
|
```
|
||||||
29
.gitlab/make/docker.makefile
Normal file
29
.gitlab/make/docker.makefile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
.PHONY: docker-init
|
||||||
|
docker-init:
|
||||||
|
@touch VERSION
|
||||||
|
@touch IMAGE
|
||||||
|
|
||||||
|
.PHONY: buildx-context
|
||||||
|
buildx-context:
|
||||||
|
docker buildx create --name container-builder --use --platform linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
.PHONY: buildx-clear
|
||||||
|
buildx-clear:
|
||||||
|
docker buildx rm container-builder
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build:
|
||||||
|
docker buildx build --load . -t $(IMAGE)
|
||||||
|
@docker buildx build --load . -t $(IMAGE_LATEST)
|
||||||
|
|
||||||
|
.PHONY: push
|
||||||
|
push:
|
||||||
|
-make buildx-clear
|
||||||
|
@make buildx-context
|
||||||
|
docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE)
|
||||||
|
@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
|
||||||
5
.gitlab/make/git.makefile
Normal file
5
.gitlab/make/git.makefile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
.PHONY: git-release
|
||||||
|
git-release:
|
||||||
|
@git add .
|
||||||
|
@git commit -m "Automated release for version $(VERSION)"
|
||||||
|
@git tag $(VERSION)
|
||||||
4
.gitlab/make/helm.makefile
Normal file
4
.gitlab/make/helm.makefile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.PHONY: helm-release
|
||||||
|
helm-release:
|
||||||
|
@yq e ".version = \"$(shell cat VERSION)\"" -i helm/Chart.yaml
|
||||||
|
@yq e ".appVersion = \"$(shell cat VERSION)\"" -i helm/Chart.yaml
|
||||||
0
.gitlab/make/kaniko.makefile
Normal file
0
.gitlab/make/kaniko.makefile
Normal file
3
.gitlab/make/truenas.makefile
Normal file
3
.gitlab/make/truenas.makefile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.PHONY: chart-release
|
||||||
|
chart-release:
|
||||||
|
@rsync -av $(CHART)/helm/ charts/$(CHART)/$(shell cat $(CHART)/VERSION)/
|
||||||
Reference in New Issue
Block a user