mirror of
https://github.com/drone-plugins/drone-webhook.git
synced 2026-06-14 05:12:43 +08:00
Make the builds reproducable based on commit sha
This commit is contained in:
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
EXECUTABLE ?= drone-webhook
|
EXECUTABLE ?= drone-webhook
|
||||||
IMAGE ?= plugins/$(EXECUTABLE)
|
IMAGE ?= plugins/$(EXECUTABLE)
|
||||||
|
COMMIT ?= $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
LDFLAGS = -X "main.buildDate=$(shell date -u '+%Y-%m-%d %H:%M:%S %Z')"
|
LDFLAGS = -X "main.buildCommit=$(COMMIT)"
|
||||||
PACKAGES = $(shell go list ./... | grep -v /vendor/)
|
PACKAGES = $(shell go list ./... | grep -v /vendor/)
|
||||||
|
|
||||||
all: deps build test
|
all: deps build test
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
buildDate string
|
buildCommit string
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Printf("Drone Webhook Plugin built at %s\n", buildDate)
|
fmt.Printf("Drone Webhook Plugin built from %s\n", buildCommit)
|
||||||
|
|
||||||
system := drone.System{}
|
system := drone.System{}
|
||||||
repo := drone.Repo{}
|
repo := drone.Repo{}
|
||||||
|
|||||||
Reference in New Issue
Block a user