k3s/scripts/version.sh
Darren Shepherd 6fa7f5b3ae Clean up build scripts
Switch binaries to armhf suffix to be more clean on the on
architecture
2019-01-24 10:51:37 -07:00

18 lines
349 B
Bash
Executable File

#!/bin/bash
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi
COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)}
if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VERSION=$GIT_TAG
else
VERSION="${COMMIT}${DIRTY}"
fi
ARCH=$(go env GOARCH)
SUFFIX="-${ARCH}"