-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
36 lines (29 loc) · 889 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
35
36
VERSION := $(shell git describe HEAD)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD | tr / -)
BUILD := 0
DOCKER_REPO := diffeo/coordinated
DOCKER_IMG := $(DOCKER_REPO):$(VERSION)
.PHONY: test docker docker-push-branch docker-push-latest
test:
go test -race -v ./...
docker:
docker build \
--build-arg VERSION=$(VERSION) \
--build-arg BUILD=$(BUILD) \
--build-arg NOW=$(shell TZ=UTC date +%Y-%m-%dT%H:%M:%SZ) \
-t $(DOCKER_IMG) \
.
docker-push-branch:
# Only intended for CI
[ ! -z "$$CI" ]
# Push a "latest" tag to our repository
docker tag $(DOCKER_IMG) $(DOCKER_REPO):$(BRANCH)
docker push $(DOCKER_REPO):$(BRANCH)
docker-push-latest:
# Only intended for CI
[ ! -z "$$CI" ]
# Push image to our repository
docker push $(DOCKER_IMG)
# Push a "latest" tag to our repository
docker tag $(DOCKER_IMG) $(DOCKER_REPO):latest
docker push $(DOCKER_REPO):latest