forked from gliderlabs/herokuish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (41 loc) · 1.48 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
NAME = herokuish
HARDWARE = $(shell uname -m)
VERSION ?= 0.3.2
IMAGE_NAME ?= $(NAME)
BUILD_TAG ?= dev
build:
cat buildpacks/*/buildpack* | sed 'N;s/\n/ /' > include/buildpacks.txt
go-bindata include
mkdir -p build/linux && GOOS=linux go build -ldflags "-X main.Version $(VERSION)" -o build/linux/$(NAME)
mkdir -p build/darwin && GOOS=darwin go build -ldflags "-X main.Version $(VERSION)" -o build/darwin/$(NAME)
ifeq ($(CIRCLECI),true)
docker build -t $(IMAGE_NAME):$(BUILD_TAG) .
else
docker build -f Dockerfile.dev -t $(IMAGE_NAME):$(BUILD_TAG) .
endif
build-in-docker:
docker build -f Dockerfile.build -t $(NAME)-build .
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/usr/src/myapp -w /usr/src/myapp \
-e IMAGE_NAME=$(IMAGE_NAME) -e BUILD_TAG=$(BUILD_TAG) -e VERSION=master \
$(NAME)-build make -e deps build
docker rmi $(NAME)-build || true
deps:
docker pull heroku/cedar:14
go get -u github.com/jteeuwen/go-bindata/...
go get -u github.com/progrium/gh-release/...
go get -u github.com/progrium/basht/...
go get || true
test:
basht tests/*/tests.sh
circleci:
docker version
rm -f ~/.gitconfig
mv Dockerfile.dev Dockerfile
release: build
rm -rf release && mkdir release
tar -zcf release/$(NAME)_$(VERSION)_linux_$(HARDWARE).tgz -C build/linux $(NAME)
tar -zcf release/$(NAME)_$(VERSION)_darwin_$(HARDWARE).tgz -C build/darwin $(NAME)
gh-release create gliderlabs/$(NAME) $(VERSION) \
$(shell git rev-parse --abbrev-ref HEAD) v$(VERSION)
.PHONY: build