radiasoft / ansible-conf

Radiasoft playbooks
Apache License 2.0
0 stars 1 forks source link

Can't `git clone` inside Jenkins Container #7

Closed elventear closed 7 years ago

elventear commented 8 years ago

Because we map the Jenkins uid within the container to the uidwithin the host, we have a situation, where Jenkins executes as a user that does not exist in /etc/passwd, which triggers:

fatal: unable to look up current user in the passwd file: no such user

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1723)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1459)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
    ... 8 more

GitHub has been notified of this commit’s build result

This happens, because git is trying to figure out the user name and email, for commits. One possibility is setting GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL environment variables. A better solution is to try to pass those settings to Jenkins somehow (The pipeline plugin does not seem to provide that).