1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

Refactor build scripts

This commit is contained in:
Darren Shepherd
2016-05-06 10:12:09 -07:00
parent acc2ee297a
commit ec410addb9
103 changed files with 1310 additions and 632 deletions

24
scripts/version Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi
COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)
if [ -z "$VERSION" ]; then
if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VERSION=$GIT_TAG
else
VERSION="${COMMIT}${DIRTY}"
fi
fi
export VERSION COMMIT
# Suffix
export SUFFIX=""
if [ -n "${ARCH}" ] && [ "${ARCH}" != "amd64" ]; then
SUFFIX="_${ARCH}"
fi