You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Especially when implementing extensive Git Operations in Jenkins (e.g. GitFlow or GitOps) it might be important to rely specific git features (or avoid bugs fixed in specific versions).
However, when using the Git class as is, the calls are executed by the git client provided by the Jenkins agent. This makes the outcome of calls to the methods of Git strongly dependend on the agent.
This fact can be changed by executing all Git Commands in a Container that contains a deterministic version of git.
We could implement this similar to MavenInDocker, by deriving from Git and overriding a method that executes all script.sh calls for Git.
In this method we could wrap the original method to be executed in a container, e.g. like so:
new Docker(this).image("alpine/git:v${gitVersion}")
.mountJenkinsUser()
.inside('--entrypoint=""') {
super.method()
}
The text was updated successfully, but these errors were encountered:
Especially when implementing extensive Git Operations in Jenkins (e.g. GitFlow or GitOps) it might be important to rely specific git features (or avoid bugs fixed in specific versions).
However, when using the
Git
class as is, the calls are executed by thegit
client provided by the Jenkins agent. This makes the outcome of calls to the methods ofGit
strongly dependend on the agent.This fact can be changed by executing all Git Commands in a Container that contains a deterministic version of git.
We could implement this similar to
MavenInDocker
, by deriving from Git and overriding a method that executes allscript.sh
calls forGit
.In this method we could wrap the original method to be executed in a container, e.g. like so:
The text was updated successfully, but these errors were encountered: