Make the builds reproducable based on commit sha
This commit is contained in:
parent
a352b7639e
commit
6ae77a6b5c
3
Makefile
3
Makefile
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
EXECUTABLE ?= drone-email
|
EXECUTABLE ?= drone-email
|
||||||
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
|
||||||
|
|
4
main.go
4
main.go
|
@ -9,11 +9,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
buildDate string
|
buildCommit string
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Printf("Drone Email Plugin built at %s\n", buildDate)
|
fmt.Printf("Drone Email Plugin built from %s\n", buildCommit)
|
||||||
|
|
||||||
system := drone.System{}
|
system := drone.System{}
|
||||||
repo := drone.Repo{}
|
repo := drone.Repo{}
|
||||||
|
|
Loading…
Reference in a new issue