aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2021-01-24 12:36:39 -0500
committerMitch Riedstra <mitch@riedstra.us>2021-01-24 12:36:39 -0500
commit023ce2fd00c2269202969c1750e237a6c9c8f985 (patch)
tree0eb54e9bffd3acad657182f62cda0bd97836ba46 /build.sh
parentbad568d0a26ad348f25a4556266ba98f73b3be02 (diff)
downloadcheckup-023ce2fd00c2269202969c1750e237a6c9c8f985.tar.gz
checkup-023ce2fd00c2269202969c1750e237a6c9c8f985.tar.xz
Add a build script, license and version.
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..2a92868
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+set -e
+
+LICENSE="$(cat LICENSE)"
+
+version="$(git log --format="%h %d" -1)
+$(go version)
+Build Date: $(date +%m.%d.%Y)
+Source code can be found here:
+https://git.riedstra.dev/go/checkup
+
+$LICENSE"
+
+if ! git diff-index --quiet HEAD ; then
+ version="dirty: $version"
+fi
+
+export CGO_ENABLED=0
+
+go build -o checkup -ldflags="-X 'main.Version=$version'" ./cmd/main