mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
SOURCE_COMMIT doesn't work, generate version from git
SOURCE_COMMIT is always empty, for both manual and automated builds, work around it by running git
This commit is contained in:
@@ -10,9 +10,10 @@ if [[ $DOCKER_TAG == v* ]]; then
|
||||
# it's only a release tag, let's use that as the version
|
||||
VERSION=${DOCKER_TAG}
|
||||
else
|
||||
# for everything else use branch-commit as the version, e.g.
|
||||
# master-abcdef
|
||||
VERSION=${SOURCE_BRANCH}-${SOURCE_COMMIT:-latest}
|
||||
# for everything else generate version from branch name and git tag/commit
|
||||
# it would be best to use SOURCE_COMMIT here, but it doesn't work
|
||||
# see https://github.com/docker/hub-feedback/issues/600
|
||||
VERSION=$(git describe --tags --always)-${SOURCE_BRANCH}
|
||||
fi
|
||||
|
||||
docker build --build-arg VERSION=${VERSION} -t ${IMAGE_NAME} .
|
||||
|
||||
Reference in New Issue
Block a user