From cefcb79b75358a2e1a8a9ef0b9d902bafde74ec9 Mon Sep 17 00:00:00 2001 From: Chung-Ting Huang Date: Tue, 24 Jul 2018 14:55:18 -0500 Subject: [PATCH] TUN-804: create Makefile recipe to build cloudflared and run tests remove execess packages from cfsetup --- Makefile | 14 ++++++++++++++ cfsetup.yaml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Makefile create mode 100644 cfsetup.yaml diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..cc365ab6 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +VERSION := $(shell git describe --tags --always --dirty="-dev") +DATE := $(shell date -u '+%Y-%m-%d-%H%M UTC') +VERSION_FLAGS := -ldflags='-X "main.Version=$(VERSION)" -X "main.BuildTime=$(DATE)"' + +.PHONY: all +all: cloudflared test + +.PHONY: cloudflared +cloudflared: + go build -v $(VERSION_FLAGS) ./... + +.PHONY: test +test: + go test -v -race $(VERSION_FLAGS) ./... diff --git a/cfsetup.yaml b/cfsetup.yaml new file mode 100644 index 00000000..b77b7d8e --- /dev/null +++ b/cfsetup.yaml @@ -0,0 +1,14 @@ +pinned_go: &pinned_go go=1.9.3-1 +build_dir: &build_dir /cfsetup_build/src/github.com/cloudflare/cloudflared/ +stretch: + build: + build_dir: *build_dir + builddeps: + - *pinned_go + - build-essential + post-cache: + - export GOPATH=/cfsetup_build/ + - export CGO_ENABLED=1 + - export GOOS=linux + - export GOARCH=amd64 + - make all