-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 844 Bytes
/
Makefile
File metadata and controls
34 lines (26 loc) · 844 Bytes
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
IMAGE ?= tweedproject/kernel
TAG ?= edge
NAMESPACE ?= tweed
VERSION ?=
BUILD ?= $(shell ./build/build-number)
LDFLAGS := -X main.Version="$(VERSION)" -X main.BuildNumber="$(BUILD)"
.PHONY: test
default:
go fmt . ./api ./cmd/tweed
go build -ldflags="$(LDFLAGS)" ./cmd/tweed
docker:
docker build -t $(IMAGE):$(TAG) .
docker push $(IMAGE):$(TAG)
push:
@echo "Checking that VERSION was defined in the calling environment"
@test -n "$(VERSION)"
@echo "OK. VERSION=$(VERSION)"
docker build -t $(IMAGE):$(VERSION) .
docker push $(IMAGE):$(VERSION)
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest
for V in $(VERSION) $(shell echo "$(VERSION)" | sed -e 's/\.[^.]*$$//') $(shell echo "$(VERSION)" | sed -e 's/\..*$$//'); do \
docker tag $(IMAGE):$(VERSION) $(IMAGE):$$V; \
docker push $(IMAGE):$$V; \
done
test:
./test/the all