From b825bbba7ce03b92d721f25aac7093f7f6660fc8 Mon Sep 17 00:00:00 2001 From: Martin Treml Date: Tue, 7 Mar 2017 22:27:42 +0100 Subject: [PATCH] added makefile job for travis-ci --- .travis.yml | 2 +- Makefile | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20c8267..7947c7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ install: - make deps script: - make test - - make ci-dist + - make travis-ci-dist deploy: provider: releases skip_cleanup: true diff --git a/Makefile b/Makefile index 6e083a8..55310e1 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ help: @echo "make dev-image - build development image" @echo "make dockerhub - build and push image to Docker Hub" @echo "make version - show app version" - @echo "make ci-dist - Build distribution files" + @echo "make travis-ci-dist - Build distribution files with for travis" build: build-dir CGO_ENABLED=0 GOOS=$(PLATFORM) GOARCH=$(ARCH) godep go build -ldflags "-X main.Version=$(VERSION) -X main.GitSHA=$(GITSHA)" -o build/$(PROJECT)-$(PLATFORM)-$(ARCH) @@ -78,6 +78,15 @@ build-dir: dist-dir: @rm -rf dist && mkdir dist +travis-ci-dist: ci-compile dist-dir + $(eval FILES := $(shell ls build)) + @for f in $(FILES); do \ + (cd $(shell pwd)/build/$$f && tar -cvzf ../../dist/$$f.tar.gz *); \ + (cd $(shell pwd)/dist && shasum -a 256 $$f.tar.gz > $$f.sha256); \ + (cd $(shell pwd)/dist && md5sum $$f.tar.gz > $$f.md5); \ + echo $$f; \ + done + ci-dist: ci-compile dist-dir $(eval FILES := $(shell ls build)) @for f in $(FILES); do \