-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
33 lines (22 loc) · 907 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
CONTAINER_IMAGE ?= "docker.io/rochacon/bastrd"
CONTAINER_IMAGE_TOOLBOX ?= "docker.io/rochacon/bastrd-toolbox"
VERSION ?= $$(git describe --abbrev=10 --always --dirty --tags)
default: binary
all: test binary image toolbox publish_binary publish_image publish_toolbox
binary:
go build -v -ldflags "-X main.VERSION=$(VERSION)" -tags "netgo osusergo"
image:
docker build -t $(CONTAINER_IMAGE):$(VERSION) .
publish: publish_binary publish_image publish_image_toolbox
publish_binary:
gzip -k -f bastrd
aws s3 cp ./bastrd.gz s3://bastrd-dev/bastrd.gz --acl public-read
publish_image:
docker push $(CONTAINER_IMAGE):$(VERSION)
publish_toolbox:
docker push $(CONTAINER_IMAGE_TOOLBOX):$(VERSION)
test:
go test $(ARGS) ./...
toolbox:
docker build -f Dockerfile.toolbox -t $(CONTAINER_IMAGE_TOOLBOX):$(VERSION) .
.PHONY: binary image publish publish_binary publish_image publish_toolbox test toolbox