Skip to content

Commit

Permalink
[JENKINS-30656] Add DISPLAY env variable only if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsirot committed Dec 16, 2015
1 parent 727083b commit 3ee2ffb
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -155,7 +155,11 @@ protected ArgumentListBuilder appendCredentials(ArgumentListBuilder args)
if (privateKeyCredentials.getPassphrase() != null) {
script = Utils.createSshAskPassFile(script, ws, privateKeyCredentials, copyCredentialsInWorkspace);
environment.put("SSH_ASKPASS", script.getRemote());
environment.put("DISPLAY", "nodisplay");
// inspired from https://github.com/jenkinsci/git-client-plugin/pull/168
// but does not work with MacOSX
if (! environment.containsKey("DISPLAY")) {
environment.put("DISPLAY", ":123.456");
}
}
} else if (credentials instanceof UsernamePasswordCredentials) {
args.add("-u").add(credentials.getUsername());
Expand Down

0 comments on commit 3ee2ffb

Please sign in to comment.