forked from major/icanhaz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
24 lines (20 loc) · 844 Bytes
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# The version of the container will be the name of the most recent git tag. Before building a new container,
# please tag the repo with the new version number.
version = $(shell git for-each-ref --sort=-taggerdate --format '%(refname:short)' refs/tags | head -n 1)
.phony: all container
all:
@echo The current tagged version is $(version)
@echo Run 'make container' to build a new container and tag it with this version.
container:
@echo Checking for untagged changes...
test -z "$(shell git status --porcelain)"
git diff-index --quiet $(version)
@echo Repo is clean.
@echo Building container...
docker build --pull --build-arg version="$(version)" \
--tag lykinsbd/icanhaz:$(version) \
--tag lykinsbd/icanhaz:latest .
push:
@echo Pushing container...
docker push lykinsbd/icanhaz:$(version)
docker push lykinsbd/icanhaz:latest