Squashed '.gitlab/' changes from 9eed509..731ada6
731ada6Merge branch 'make-update-fixes' into 'main'c3e6d73Switch to "subtree split" push strategy3c91292Make user stash their own damn changesd86b505Add PROJECT_NAME and VERSION9d0c9c6Update README with "common" remote30fb8c2Merge branch 'docker-buidlx-overhaul' into 'main'fd96b3fMerge branch 'git-release' into 'main'a6053edAdd make git-release3563c5cAdd make docker-release40a217bUse buildx to create multi-arch images5e2bc5fSwitch to container-builder buildx platform git-subtree-dir: .gitlab git-subtree-split:731ada6a3d
This commit is contained in:
15
Makefile
15
Makefile
@@ -1,6 +1,8 @@
|
||||
SHELL := /bin/bash
|
||||
|
||||
IMAGE ?= $(shell cat IMAGE):$(shell cat VERSION)
|
||||
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"
|
||||
@@ -9,6 +11,7 @@ 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:
|
||||
@@ -22,14 +25,10 @@ make-stash-drop:
|
||||
|
||||
.PHONY: make-update
|
||||
make-update:
|
||||
@git stash save $(STASH)
|
||||
-git subtree pull --prefix .gitlab git@gitlab.ducoterra.net:services/common.git main
|
||||
@if [ ! -z "$$(git stash list | grep -r 'stash@{0}.*common')" ]; then git stash pop; fi
|
||||
@git subtree pull --prefix .gitlab --message "Merge update from Common" -q common main
|
||||
|
||||
.PHONY: make-push
|
||||
make-push: warning
|
||||
@make make-update
|
||||
@git remote add common git@gitlab.ducoterra.net:services/common.git
|
||||
@git subtree push --prefix .gitlab common main
|
||||
@git remote remove common
|
||||
@make make-update
|
||||
@git subtree split --branch common/$(PROJECT_NAME) --prefix .gitlab
|
||||
@git push common common/$(PROJECT_NAME):common/$(PROJECT_NAME)
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
```bash
|
||||
# Add the subtree as a remote
|
||||
git subtree add --prefix .gitlab git@gitlab.ducoterra.net:services/common.git main --squash
|
||||
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
|
||||
|
||||
@@ -5,18 +5,25 @@ docker-init:
|
||||
|
||||
.PHONY: buildx-context
|
||||
buildx-context:
|
||||
docker buildx create --name arm64 --use --platform linux/amd64,linux/arm64
|
||||
docker buildx create --name container-builder --use --platform linux/amd64,linux/arm64
|
||||
|
||||
.PHONY: buildx-clear
|
||||
buildx-clear:
|
||||
docker buildx rm arm64
|
||||
docker buildx rm container-builder
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
docker buildx build --load . -t $(IMAGE)
|
||||
@docker buildx build --load . -t $(IMAGE_LATEST)
|
||||
@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)
|
||||
-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
make/git.makefile
Normal file
5
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)
|
||||
Reference in New Issue
Block a user