ci: allow /opt/build for git repository when deploying jobs

When Jenkins Jobs have been modified, they should get deployed in the
Jenkins environment. This seems to fail with the following error:

```
Initialized empty Git repository in /opt/build/.git/
fatal: detected dubious ownership in repository at '/opt/build'
To add an exception for this directory, call:

	git config --global --add safe.directory /opt/build
```

By marking /opt/build as a safe directory in the global git
configuration file, this problem should not occur anymore.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2023-01-30 13:56:30 +01:00 committed by Madhu Rajanna
parent f7ba14b2ed
commit 234471af33

View File

@ -11,6 +11,7 @@ fail() {
# exit in case a command fails
set -e
git config --global --add safe.directory ${PWD}
git init .
git remote add origin "${GIT_REPO}"
git fetch origin "${GIT_REF}"