Updated withGiteaCreds function

This commit is contained in:
Daniel Weissmall 2023-12-04 21:10:54 +03:00
parent c662a25432
commit 5f7f1d25b4

@ -44,9 +44,22 @@ def withGiteaCreds(String credentialsId, String gitToolName, Closure body) {
gitToolName: gitToolName
)
]) {
errorMessage = "Unable to set git config"
sh "git config user.name ${env.GIT_USERNAME} || echo $errorMessage"
sh "git config user.email admin@dipal.ru || echo $errorMessage"
try {
errorMessage = "Unable to set git config"
sh "git config user.name ${env.GIT_USERNAME} || echo $errorMessage"
sh "git config user.email admin@dipal.ru || echo $errorMessage"
} catch (error) {
sh "echo $error"
}
try {
errorMessage = "Unable to set git config"
sh "git config --global user.name ${env.GIT_USERNAME} || echo $errorMessage"
sh "git config --global user.email admin@dipal.ru || echo $errorMessage"
} catch (error) {
sh "echo $error"
}
body()
}
}