From e7b07c7f84dae74fc3442953db7585140efa8c6c Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 1 Nov 2021 10:05:13 -0400 Subject: [PATCH] Squashed '.gitlab/' changes from 2f76759..22a952d 22a952d Remove warning from make-update 0f6eeb7 Add make-stash-drop command f81d846 Only pop stash if changes afed93f Add warning to make-update and make-push 6239af7 Ignore git stash pop failures git-subtree-dir: .gitlab git-subtree-split: 22a952dd53cc97522d5f0d7826c028acf03413a8 --- Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cb8e27c..320f9d4 100644 --- a/Makefile +++ b/Makefile @@ -3,20 +3,31 @@ SHELL := /bin/bash IMAGE ?= $(shell cat IMAGE):$(shell cat 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 +.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 stash + @git stash save $(STASH) -git subtree pull --prefix .gitlab git@gitlab.ducoterra.net:services/common.git main --squash - @git stash pop + @if [ ! -z "$$(git stash list | grep -r 'stash@{0}.*common')" ]; then git stash pop; fi .PHONY: make-push -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