aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2019-12-14 09:51:15 -0500
committerMitch Riedstra <mitch@riedstra.us>2019-12-14 09:51:15 -0500
commitb2056fbf48849e321389977e3fdbb0f5841822c4 (patch)
tree0f0b993d1f2ea0221067e4f689e606e33ba47bbd /build.sh
parentc19536be6e4f8733af329204a50ffc254a679ee5 (diff)
downloadgo-website-b2056fbf48849e321389977e3fdbb0f5841822c4.tar.gz
go-website-b2056fbf48849e321389977e3fdbb0f5841822c4.tar.xz
Tidy up the server command, pull the handlers into the page library. Convert to go modules. Add a build script and version to the command
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100644
index 0000000..e8630f3
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -x
+set -e
+
+version="$(git log --format="%h %d" -1)"
+
+if ! git diff-index --quiet HEAD ; then
+ version="dirty: $version"
+fi
+
+go build -ldflags="-X 'main.VersionString=$version'" ./cmd/server