mirror of
https://git.icinga.com/packaging/rpm-icingaweb2.git
synced 2025-07-29 17:04:05 +02:00
get_snapshot: Support UPSTREAM_GIT_NOUPDATE
And do not manage git when set!
This commit is contained in:
parent
910e596397
commit
a4543cb1c2
17
get_snapshot
17
get_snapshot
@ -37,16 +37,21 @@ if [ -d "${PROJECT}.git/" ]; then
|
|||||||
echo "This is not a GIT repository: $(pwd)" >&2
|
echo "This is not a GIT repository: $(pwd)" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$(git config remote.origin.url)" != "${UPSTREAM_GIT_URL}" ]; then
|
if [ -z "$UPSTREAM_GIT_NOUPDATE" ]; then
|
||||||
git remote set-url origin "${UPSTREAM_GIT_URL}"
|
if [ "$(git config remote.origin.url)" != "${UPSTREAM_GIT_URL}" ]; then
|
||||||
|
git remote set-url origin "${UPSTREAM_GIT_URL}"
|
||||||
|
fi
|
||||||
|
git fetch origin -p
|
||||||
|
git checkout -f "${UPSTREAM_GIT_BRANCH}"
|
||||||
|
git reset --hard "origin/${UPSTREAM_GIT_BRANCH}"
|
||||||
fi
|
fi
|
||||||
git fetch origin -p
|
|
||||||
git checkout -f "${UPSTREAM_GIT_BRANCH}"
|
|
||||||
git reset --hard "origin/${UPSTREAM_GIT_BRANCH}"
|
|
||||||
git clean -fdx
|
git clean -fdx
|
||||||
else
|
elif [ -z "$UPSTREAM_GIT_NOUPDATE" ]; then
|
||||||
git clone -b "${UPSTREAM_GIT_BRANCH}" "${UPSTREAM_GIT_URL}" "${PROJECT}.git/"
|
git clone -b "${UPSTREAM_GIT_BRANCH}" "${UPSTREAM_GIT_URL}" "${PROJECT}.git/"
|
||||||
cd "${PROJECT}.git"
|
cd "${PROJECT}.git"
|
||||||
|
else
|
||||||
|
echo "Missing '${PROJECT}.git' directory!" >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git_version=$(git describe --tags HEAD)
|
git_version=$(git describe --tags HEAD)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user