diff --git a/.travis b/.travis new file mode 100644 index 0000000..3ded0dd --- /dev/null +++ b/.travis @@ -0,0 +1,27 @@ +sudo: required +language: go + +go: + - 1.9.x + +services: + - docker + +addons: + apt: + packages: + - docker-ce + +before_install: + - go get github.com/estesp/manifest-tool + +script: + - make build docker-build + +after_success: + - if [ -z "DOCKER_USER" ]; then + echo "PR build, skipping Docker Hub push"; + else + docker login -u $DOCKER_USER -p $DOCKER_PASS; + make docker-push; + fi diff --git a/Makefile b/Makefile index 94c7681..cf9267f 100644 --- a/Makefile +++ b/Makefile @@ -2,17 +2,13 @@ # # The release version is controlled from pkg/version # -# Prerequsitesx: - +# Prerequisites: +# 1) docker login (change the DOCKER_REPOSITORY to match your Docker Hub user) +# 2) go get github.com/estesp/manifest-tool EMPTY:= SPACE:=$(EMPTY) $(EMPTY) COMMA:=$(EMPTY),$(EMPTY) - -ifeq (, $(shell which manifest-tool)) - $(error "No manifest-tool in $$PATH, install with: go get github.com/estesp/manifest-tool") -endif - DOCKER_REPOSITORY:=stefanprodan NAME:=podinfo VERSION:=$(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4 }' | tr -d '"') @@ -21,9 +17,6 @@ GITCOMMIT:=$(shell git describe --dirty --always) LINUX_ARCH:=amd64 arm arm64 ppc64le PLATFORMS:=$(subst $(SPACE),$(COMMA),$(foreach arch,$(LINUX_ARCH),linux/$(arch))) -all: - @echo Use the 'release' target to start a release - release: build tar docker: docker-build docker-push