Skip to content

Commit

Permalink
Merge pull request #1561 from craigcomstock/ENT-12498
Browse files Browse the repository at this point in the history
Adjusted build host script to allow for not using git
  • Loading branch information
craigcomstock authored Dec 19, 2024
2 parents b2da699 + 52041d4 commit efa7d00
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ci/setup-cfengine-build-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ trap cleanup SIGTERM
echo "Using buildscripts commit:"
# we have very old platforms with old git that doesn't understand -C option so cd/cd .. it is
cd buildscripts
# buildscripts is owned by jenkins so in order to run rev-parse command as root (this script is run with sudo) we must make it safe
git config --global --add safe.directory /home/jenkins/buildscripts
git rev-parse HEAD
# buildscripts is owned by jenkins so in order to run rev-parse command as root (this script is run with sudo) we must make it safe if git is used
if [ -d /home/jenkins/buildscripts/.git ]; then
if command -v git >/dev/null; then
git config --global --add safe.directory /home/jenkins/buildscripts
# show what version of buildscripts we are using
git rev-parse HEAD
else
echo "buildscripts/.git is present but git is not installed"
exit 1
fi
fi
cd ..

echo "Install any distribution upgrades"
Expand Down

0 comments on commit efa7d00

Please sign in to comment.