-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (39 loc) · 1.36 KB
/
Makefile
File metadata and controls
50 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
IMAGE_ABSOLUTE_PATHS = $(shell find ${CURDIR} -mindepth 1 -maxdepth 1 -type d | grep -v '\.[a-zA-Z0-9]*$$' | sort)
SUBDIRS = $(notdir ${IMAGE_ABSOLUTE_PATHS})
.PHONY: build clean upstream clean-composite-dockerfile composite-dockerfile upstream-confirm $(SUBDIRS)
build: $(SUBDIRS)
clean: $(SUBDIRS)
clean-composite-dockerfile:
rm -f Dockerfile.composite.*
# We only support composite-dockerfiles to simplify multi-arch builds
# because buildx can't publish manifests to local registries which means
# we can't use the `FROM dev-base:local` statements.
composite-dockerfile: clean-composite-dockerfile $(SUBDIRS)
upstream-confirm:
@echo "Are you sure you want to delete _slash's .git (and more) directories?"
@echo "If you have local changes you want to keep, you should commit and push them first."
@echo -n "[y/N] : "
@read ans; if [ "$$ans" != "y" ]; then exit 1; fi
upstream: upstream-confirm $(SUBDIRS)
rm -rf .git
rm -rf .github
remote:
git init
git remote add origin $${GIT_REMOTE}
git fetch origin main
git reset --soft origin/main
git add .
remote-clean: remote
git restore --staged .
git checkout -- .
git checkout main
$(SUBDIRS):
@$(MAKE) -C $@ ${MAKECMDGOALS}
# We release on tags starting with v
release:
git tag v$(VERSION)
git push origin v$(VERSION)
# Nuke the remote tag
unrelease:
git tag -d v$(VERSION)
git push --delete origin v$(VERSION)