-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
31 lines (23 loc) · 728 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
.PHONY: ci-build ci-run ci-test ci-remove ci-push-tag ci-push-latest ci-login
NAME := os-packager
ORG := openspending
REPO := ${ORG}/${NAME}
TAG := $(shell git log -1 --pretty=format:"%h")
IMG := ${REPO}:${TAG}
LATEST := ${REPO}:latest
ci-build:
docker build -t ${IMG} -t ${LATEST} .
ci-run:
docker run ${RUN_ARGS} --name ${NAME} -d ${LATEST}
ci-test:
docker ps | grep latest
ci-remove:
docker rm -f ${NAME}
ci-push: ci-login
docker push ${IMG}
docker push ${LATEST}
ci-push-tag: ci-login
docker build -t ${REPO}:${TAG}-$(shell git log -1 --pretty=format:"%h") .
docker push ${REPO}:${TAG}-$(shell git log -1 --pretty=format:"%h")
ci-login:
docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}