TUN-804: create Makefile recipe to build cloudflared and run tests
remove execess packages from cfsetup
This commit is contained in:
		
							parent
							
								
									7c084ad32b
								
							
						
					
					
						commit
						cefcb79b75
					
				| 
						 | 
				
			
			@ -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) ./...
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
		Loading…
	
		Reference in New Issue