本文整理了Java中hudson.model.Job.getEnvironment()
方法的一些代码示例,展示了Job.getEnvironment()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getEnvironment()
方法的具体详情如下:
包路径:hudson.model.Job
类名称:Job
方法名:getEnvironment
[英]Creates an environment variable override for launching processes for this project.
This is for process launching outside the build execution (such as polling, tagging, deployment, etc.) that happens in a context of a specific job.
[中]
代码示例来源:origin: jenkinsci/jenkins
@Override
public EnvVars getEnvironment(Node node, TaskListener listener) throws IOException, InterruptedException {
EnvVars env = super.getEnvironment(node, listener);
JDK jdkTool = getJDK();
if (jdkTool != null) {
if (node != null) { // just in case were not in a build
jdkTool = jdkTool.forNode(node, listener);
}
jdkTool.buildEnvVars(env);
} else if (!JDK.isDefaultName(jdk)) {
listener.getLogger().println("No JDK named ‘" + jdk + "’ found");
}
return env;
}
代码示例来源:origin: jenkinsci/jenkins
Node n = c==null ? null : c.getNode();
EnvVars env = getParent().getEnvironment(n,listener);
env.putAll(getCharacteristicEnvVars());
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
public EnvVars superGetEnvironment(Node node, TaskListener listener) throws IOException, InterruptedException {
return super.getEnvironment(node, listener);
}
代码示例来源:origin: openshift/jenkins-plugin
@Override
public PollingResult compareRemoteRevisionWith(@Nonnull Job<?, ?> project,
@Nullable Launcher launcher, @Nullable FilePath workspace,
@Nonnull TaskListener listener, @Nonnull SCMRevisionState baseline)
throws IOException, InterruptedException {
return compareRemoteRevisionInternal(
project.getEnvironment(null, listener), launcher, listener,
baseline);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
public EnvVars getEnvironment(Node node, TaskListener listener) throws IOException, InterruptedException {
EnvVars env = super.getEnvironment(node, listener);
JDK jdkTool = getJDK();
if (jdkTool != null) {
if (node != null) { // just in case were not in a build
jdkTool = jdkTool.forNode(node, listener);
}
jdkTool.buildEnvVars(env);
} else if (!JDK.isDefaultName(jdk)) {
listener.getLogger().println("No JDK named ‘" + jdk + "’ found");
}
return env;
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@Override
public EnvVars getEnvironment(Node node, TaskListener listener) throws IOException, InterruptedException {
initPython();
if (pexec.isImplemented(16)) {
return (EnvVars) pexec.execPython("get_environment", node, listener);
} else {
return super.getEnvironment(node, listener);
}
}
代码示例来源:origin: org.jenkins-ci.plugins/git
public final URL getUrl() throws IOException {
String u = url;
StaplerRequest req = Stapler.getCurrentRequest();
if (req != null) {
Job job = req.findAncestorObject(Job.class);
if (job != null) {
EnvVars env;
try {
env = job.getEnvironment(null, TaskListener.NULL);
} catch (InterruptedException e) {
throw new IOException("Failed to retrieve job environment", e);
}
u = env.expand(url);
}
}
if (getNormalizeUrl()) {
return normalizeToEndWithSlash(new URL(u));
}
else {
return new URL(u);
}
}
代码示例来源:origin: org.jenkins-ci.plugins/git
final EnvVars environment = project instanceof AbstractProject ? GitUtils.getPollEnvironment((AbstractProject) project, workspace, launcher, listener) : project.getEnvironment(node, listener);
代码示例来源:origin: org.jenkins-ci.plugins/git
final Jenkins jenkins = Jenkins.getActiveInstance();
if (item instanceof Job) {
environment = ((Job) item).getEnvironment(jenkins, TaskListener.NULL);
} else {
environment = jenkins.toComputer().buildEnvironment(TaskListener.NULL);
代码示例来源:origin: jenkinsci/mercurial-plugin
EnvVars env = project.getEnvironment(jenkins, listener);
StandardUsernameCredentials credentials = getCredentials(project, env);
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
Node n = c==null ? null : c.getNode();
EnvVars env = getParent().getEnvironment(n,listener);
env.putAll(getCharacteristicEnvVars());
代码示例来源:origin: jenkinsci/subversion-plugin
EnvVars env = project.getEnvironment(node, listener);
代码示例来源:origin: jenkinsci/mercurial-plugin
return new PollingResult(change);
EnvVars env = project.getEnvironment(node, listener);
HgExe hg = new HgExe(findInstallation(getInstallation()), getCredentials(project, env), launcher, node, listener, env);
try {
内容来源于网络,如有侵权,请联系作者删除!