Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,22 @@ function set_base_lmp_version {
git remote set-url origin https://github.com/foundriesio/lmp-manifest
git fetch origin --tags --quiet

# 3: Find our base LMP version based on the HEAD
export LMP_VERSION=$(git describe --tags --abbrev=0 HEAD)
export LMP_VERSION_MINOR="$(git rev-list ${LMP_VERSION}..HEAD --count)"
# 3: Find our base LMP version based on the branch
# repo always checks out manifests.git on a local branch named 'default'
# regardless of the actual remote branch; resolve the real branch via tracking config
_local_branch=$(git rev-parse --abbrev-ref HEAD)
MANIFEST_BRANCH=$(git config branch.${_local_branch}.merge 2>/dev/null | sed 's|refs/heads/||')
if [ -z "$MANIFEST_BRANCH" ] ; then
# detached HEAD or no tracking info — fall back to the checked-out commit
LMP_REF=HEAD
MANIFEST_BRANCH="${_local_branch} (no tracking)"
else
git fetch origin "$MANIFEST_BRANCH" --quiet
LMP_REF="refs/remotes/origin/${MANIFEST_BRANCH}"
fi
status "Detecting LmP version from branch: ${MANIFEST_BRANCH} (ref: ${LMP_REF})"
export LMP_VERSION=$(git describe --tags --abbrev=0 $LMP_REF)
export LMP_VERSION_MINOR="$(git rev-list ${LMP_VERSION}..${LMP_REF} --count)"
export LMP_VERSION_CACHE="$(echo $LMP_VERSION | sed 's/\.[0-9]*$//')"
if [[ "${H_PROJECT}" == "lmp" ]] || [ -v LMP_VERSION_CACHE_DEV ] ; then
# Public LmP build - we are building for the *next* release
Expand Down
Loading