-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·19 lines (19 loc) · 735 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
project_path=$(cd `dirname $0`; pwd)
mkdir -p "${project_path}/prizesversion"
GITCOMMIT=$(git rev-parse --short HEAD)
VERSION=$(git describe --tags)
BUILDTIME=$(date -u -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
cat > ${project_path}/prizesversion/version.go <<DVEOF
// +build autogen
// Package prizesversion is auto-generated at build-time
package prizesversion
// Default build-time variable for library-import.
// This file is overridden on build with build-time information.
const (
GitCommit string = "$GITCOMMIT"
Version string = "$VERSION"
BuildTime string = "$BUILDTIME"
)
DVEOF
go build -work ${project_path}/cmd/prizesd/