Make the builds reproducable based on commit sha
This commit is contained in:
parent
65cfc66223
commit
22f143de4f
3
Makefile
3
Makefile
@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
EXECUTABLE ?= drone-docker
|
EXECUTABLE ?= drone-docker
|
||||||
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
@ -41,11 +41,11 @@ type Docker struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
buildDate string
|
buildCommit string
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Printf("Drone Docker Plugin built at %s\n", buildDate)
|
fmt.Printf("Drone Docker Plugin built from %s\n", buildCommit)
|
||||||
|
|
||||||
workspace := plugin.Workspace{}
|
workspace := plugin.Workspace{}
|
||||||
build := plugin.Build{}
|
build := plugin.Build{}
|
||||||
|
Loading…
Reference in New Issue
Block a user