Make the builds reproducable based on commit sha

release/0.4
Thomas Boerger 9 years ago
parent 7b5eb81d0c
commit 2d8d03bc22
  1. 3
      Makefile
  2. 4
      main.go

@ -2,8 +2,9 @@
EXECUTABLE ?= drone-github-release EXECUTABLE ?= drone-github-release
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

@ -15,11 +15,11 @@ import (
) )
var ( var (
buildDate string buildCommit string
) )
func main() { func main() {
fmt.Printf("Drone GitHub Release Plugin built at %s\n", buildDate) fmt.Printf("Drone GitHub Release Plugin built from %s\n", buildCommit)
workspace := drone.Workspace{} workspace := drone.Workspace{}
repo := drone.Repo{} repo := drone.Repo{}

Loading…
Cancel
Save