-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (25 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
VERSION := '1.0.0'
EXECUTABLE := drone-gcs
TAGS ?=
LDFLAGS ?= -X 'main.version=$(VERSION)'
TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'tempdir')
SOURCES ?= $(shell find . -name "*.go" -type f)
ifneq ($(shell uname), Darwin)
EXTLDFLAGS = -extldflags "-static" $(null)
else
EXTLDFLAGS =
endif
.PHONY: all
all: build docker deploy
docker:
@docker build -t garychen/drone-plugin-gcs .
.PHONY: build
build: $(EXECUTABLE)
$(EXECUTABLE): $(SOURCES)
@dep ensure
# @GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -tags '$(TAGS) netgo' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/linux/osx/$@
@GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags '$(TAGS) netgo' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/linux/amd64/$@
# @GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -v -tags '$(TAGS) netgo' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/linux/arm64/$@
# @GOOS=linux GOARCH=arm CGO_ENABLED=0 GOARM=7 go build -v -tags '$(TAGS) netgo' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/linux/arm/$@
deploy:
@docker push garychen/drone-plugin-gcs:latest