Skip to content

Commit

Permalink
Add makefile / travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
ryarnyah committed Jul 13, 2017
1 parent 7218d01 commit 0fd917c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sudo: required
language: go
services:
- docker
script: make -j4
deploy:
provider: releases
api_key:
secure: hcXBzyseonS4wimfE7mrrNyocIsgsv+wRK/YXVdftTu9Ik2zyMowU856UbHFYtVe2UFwYz6gBGXBm37GeaaCksgzUCE8XASqy4jXc+6Pb7PatrbM/400zIp0IAUOGWzYsxmCUidegnIg/syeny83uFcPN9Vvzx3zgxHZwB9f9j4rGyZBehsjIdr6/FJiT9PJrnO1ipPK8JSPzbO1TCj14h66BDfJB0DrrdMYoB7PvRweb3g4PXsdK7cRcyW/GzJHi8/lopeCYKoVEUqPeK5REMG5FSEDVzG6KG5F2U/UoD8D7q9F7pTBO2ZAaUP45Cf6wQPrgmak0fYGKxyyDXYMa258UZPE4brR4rejQDr7KdqCXa08HaP3LHo9UgVt2+/Y+h8DBz3ycdFts39CBMVg0Cz31pvHJdtaVg3OuHAwnJckNPpYDmqXwAGGKa4+oslT6GYGxie24UcIyoc3+KlyM8032ascLANyxd3bdz2G4fKStH09g3oQxxzuSnVoyfzp+dLM2eimkEHhmDpv4LiiQ6NQtPz98Z2nTCw/4UFBFLOF0x70c1Tfr4mctp5C0ujFGOehTW4/ovo2iLwuR9jH9sUIZhiRg82ZIY6O/godjd6J+X/jp5+b66Rr+9PDY86yJixe4vtyspsa1N9X5QWWe/UKW5E2b7SwFc1kMmLJSm8=
file:
- "local-dns-proxy-linux-amd64"
- "local-dns-proxy-linux-arm"
- "local-dns-proxy-windows-amd64"
on:
repo: ryarnyah/local-dns-proxy
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BUILD_IMAGE := ryarnyah/docker-golang-builder:latest
RELEASE_IMAGE := ryarnyah/docker-github-release:latest
GITHUB_USER := ryarnyah
GITHUB_REPO := local-dns-proxy
GIT_TAG := v0.0.1

PLATFORMS := linux/arm linux/amd64 windows/amd64

all: $(PLATFORMS)

temp = $(subst /, ,$@)
os = $(word 1, $(temp))
arch = $(word 2, $(temp))

$(PLATFORMS):
docker run --rm -e GOOS=${os} -e GOARCH=${arch} -v ${PWD}:/go/src/github.com/$(GITHUB_USER)/${GITHUB_REPO} -w /go/src/github.com/${GITHUB_USER}/${GITHUB_REPO} ${BUILD_IMAGE}

release: $(PLATFORMS)
@- $(foreach XYZ,$^, \
$(eval temp = $(subst /, ,${XYZ})) \
$(eval os = $(word 1, $(temp))) \
$(eval arch = $(word 2, $(temp))) \
\
$(shell docker run --rm -e GITHUB_USER=${GITHUB_USER} -e GITHUB_REPO=${GITHUB_REPO} -e GIT_TAG=${GIT_TAG} -e BINARY_NAME=${GITHUB_REPO}-${os}-${arch} -e GITHUB_TOKEN=${GITHUB_TOKEN} -v ${PWD}:/go/src/github.com/${GITHUB_USER}/${GITHUB_REPO} -w /go/src/github.com/${GITHUB_USER}/${GITHUB_REPO} ${RELEASE_IMAGE}) \
)

clean:
rm -f ${GITHUB_REPO}-*

.PHONY: all $(PLATFORMS) release

0 comments on commit 0fd917c

Please sign in to comment.