forked from groundnuty/k8s-wait-for
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
17 lines (12 loc) · 763 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
TAG = $(shell git describe --tags --always)
PREFIX = $(shell git config --get remote.origin.url | tr ':.' '/' | rev | cut -d '/' -f 3 | rev)
REPO_NAME = $(shell git config --get remote.origin.url | tr ':.' '/' | rev | cut -d '/' -f 2 | rev)
all: push
container: image
image:
docker build -t $(PREFIX)/$(REPO_NAME):latest . # Build new image and automatically tag it as latest
docker tag $(PREFIX)/$(REPO_NAME) $(PREFIX)/$(REPO_NAME):$(TAG) # Add the version tag to the latest image
push: image
docker push $(PREFIX)/$(REPO_NAME):latest # Push image tagged as latest to repository
docker push $(PREFIX)/$(REPO_NAME):$(TAG) # Push version tagged image to repository (since this image is already pushed it will simply create or update version tag)
clean: