-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (27 loc) · 938 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
25
26
27
28
29
30
31
32
33
34
# Makefile to kickoff Docker.
# ####################################################
#
NAME := "nitindas/aws-api-prometheus-exporter"
TAG := $$(git log --pretty=format:'' | wc -l)
# TAG := $$(git log -1 --pretty=%h)
IMG := ${NAME}:${TAG}
LATEST := ${NAME}:latest
## Before we start test that we have the mandatory executables available
EXECUTABLES = git docker
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH, consider apt-get install $(exec)")))
.PHONY: build
build:
@echo "Docker build using Dockerfile"
docker build --rm --force-rm --compress -t ${IMG} .
docker tag ${IMG} ${LATEST}
push: build
@echo "Docker push to github"
docker push ${NAME}
login:
@echo "Docker login setup"
docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}
clean-all:
@echo "Cleaning unsed container and images"
docker container prune --force
docker image prune --force