From 0893e292aae7d95c4e1999678f28ed4db960ce60 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 29 Dec 2017 08:34:47 +0800 Subject: [PATCH] feat: docker image for master. --- .drone.yml | 10 ++++++++++ Makefile | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index bec1724..07dab5a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -76,6 +76,16 @@ pipeline: when: event: [ push, tag ] + docker: + image: plugins/docker:17.05 + pull: true + secrets: [ docker_username, docker_password ] + group: release + repo: gitea/lgtm + when: + event: [ push ] + branch: [ master ] + release: image: plugins/s3:1 pull: true diff --git a/Makefile b/Makefile index 71553c2..7cdabda 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ EXECUTABLE := lgtm IMPORT := github.com/go-gitea/lgtm SHA := $(shell git rev-parse --short HEAD) +SOURCES ?= $(shell find . -name "*.go" -type f) LDFLAGS += -X "github.com/go-gitea/lgtm/version.VersionDev=$(SHA)" @@ -79,13 +80,13 @@ test-pgsql: DATABASE_DRIVER="postgres" DATABASE_DATASOURCE="postgres://postgres@pgsql:5432/postgres?sslmode=disable" go test -v -cover $(IMPORT)/store/datastore .PHONY: install -install: $(wildcard *.go) +install: $(SOURCES) go install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' .PHONY: build build: $(BIN)/$(EXECUTABLE) -$(BIN)/$(EXECUTABLE): $(wildcard *.go) +$(BIN)/$(EXECUTABLE): $(SOURCES) go build -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@ release: release-dirs release-build release-copy release-check