/** * Returns cached environment variables (copy to prevent modification) for the JVM on this computer. * If this is the master, it returns the system property of the master computer. */ public EnvVars getEnvironment() throws IOException, InterruptedException { EnvVars cachedEnvironment = this.cachedEnvironment; if (cachedEnvironment != null) { return new EnvVars(cachedEnvironment); } cachedEnvironment = EnvVars.getRemote(getChannel()); this.cachedEnvironment = cachedEnvironment; return new EnvVars(cachedEnvironment); }
/** * Performs an installation. */ private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException { Run b = p.getBuildByNumber(Integer.parseInt(id.number)); if (b==null) throw new IllegalStateException("No such build: "+id.number); Executor exec = b.getExecutor(); if (exec==null) throw new IllegalStateException(b.getFullDisplayName()+" is not building"); Node node = exec.getOwner().getNode(); if (node == null) { throw new IllegalStateException("The node " + exec.getOwner().getDisplayName() + " has been deleted"); } t = t.translate(node, EnvVars.getRemote(checkChannel()), new StreamTaskListener(stderr)); stdout.println(t.getHome()); return 0; }
/** * Gets the environment variables of the JVM on this computer. * If this is the master, it returns the system property of the master computer. */ public Map<String,String> getEnvVars() throws IOException, InterruptedException { return EnvVars.getRemote(channel); }
/** * Gets the environment variables of the JVM on this computer. If this is * the master, it returns the system property of the master computer. */ public EnvVars getEnvironment() throws IOException, InterruptedException { return EnvVars.getRemote(getChannel()); }
/** * Gets the environment variables of the JVM on this computer. * If this is the master, it returns the system property of the master computer. */ public EnvVars getEnvironment() throws IOException, InterruptedException { return EnvVars.getRemote(getChannel()); }
/** * Gets the environment variables of the JVM on this computer. * If this is the master, it returns the system property of the master computer. */ public EnvVars getEnvironment() throws IOException, InterruptedException { return EnvVars.getRemote(getChannel()); }
/** * Gets the environment variables of the JVM on this computer. * If this is the master, it returns the system property of the master computer. */ public EnvVars getEnvironment() throws IOException, InterruptedException { return EnvVars.getRemote(getChannel()); }
/** * Returns cached environment variables (copy to prevent modification) for the JVM on this computer. * If this is the master, it returns the system property of the master computer. */ public EnvVars getEnvironment() throws IOException, InterruptedException { EnvVars cachedEnvironment = this.cachedEnvironment; if (cachedEnvironment != null) { return new EnvVars(cachedEnvironment); } cachedEnvironment = EnvVars.getRemote(getChannel()); this.cachedEnvironment = cachedEnvironment; return new EnvVars(cachedEnvironment); }
/** * Gets the environment variables of the JVM on this computer. * If this is the master, it returns the system property of the master computer. */ public Map<String,String> getEnvVars() throws IOException, InterruptedException { EnvVars vars = EnvVars.getRemote(channel); if (build != null) { final Set<String> sensitiveBuildVars = build.getSensitiveBuildVariables(); vars = new EnvVars(Maps.transformEntries(vars, new Maps.EntryTransformer<String, String, String>() { public String transformEntry(String key, String value) { return sensitiveBuildVars.contains(key) ? "********" : value; } })); } return vars; }
/** * Performs an installation. */ private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException { Run b = p.getBuildByNumber(Integer.parseInt(id.number)); if (b==null) throw new IllegalStateException("No such build: "+id.number); Executor exec = b.getExecutor(); if (exec==null) throw new IllegalStateException(b.getFullDisplayName()+" is not building"); Node node = exec.getOwner().getNode(); if (node == null) { throw new IllegalStateException("The node " + exec.getOwner().getDisplayName() + " has been deleted"); } t = t.translate(node, EnvVars.getRemote(checkChannel()), new StreamTaskListener(stderr)); stdout.println(t.getHome()); return 0; }
/** * Performs an installation. */ private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException { Run b = p.getBuildByNumber(Integer.parseInt(id.number)); if (b==null) throw new AbortException("No such build: "+id.number); Executor exec = b.getExecutor(); if (exec==null) throw new AbortException(b.getFullDisplayName()+" is not building"); Node node = exec.getOwner().getNode(); if (t instanceof NodeSpecific) { NodeSpecific n = (NodeSpecific) t; t = (ToolInstallation)n.forNode(node,new StreamTaskListener(stderr)); } if (t instanceof EnvironmentSpecific) { EnvironmentSpecific e = (EnvironmentSpecific) t; t = (ToolInstallation)e.forEnvironment(EnvVars.getRemote(channel)); } stdout.println(t.getHome()); return 0; }
/** * Performs an installation. */ private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException { Run b = p.getBuildByNumber(Integer.parseInt(id.number)); if (b==null) throw new AbortException("No such build: "+id.number); Executor exec = b.getExecutor(); if (exec==null) throw new AbortException(b.getFullDisplayName()+" is not building"); Node node = exec.getOwner().getNode(); if (t instanceof NodeSpecific) { NodeSpecific n = (NodeSpecific) t; t = (ToolInstallation)n.forNode(node,new StreamTaskListener(stderr)); } if (t instanceof EnvironmentSpecific) { EnvironmentSpecific e = (EnvironmentSpecific) t; t = (ToolInstallation)e.forEnvironment(EnvVars.getRemote(channel)); } stdout.println(t.getHome()); return 0; }
/** * Performs an installation. */ private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException { Run b = p.getBuildByNumber(Integer.parseInt(id.number)); if (b==null) throw new AbortException("No such build: "+id.number); Executor exec = b.getExecutor(); if (exec==null) throw new AbortException(b.getFullDisplayName()+" is not building"); Node node = exec.getOwner().getNode(); if (t instanceof NodeSpecific) { NodeSpecific n = (NodeSpecific) t; t = (ToolInstallation)n.forNode(node,new StreamTaskListener(stderr)); } if (t instanceof EnvironmentSpecific) { EnvironmentSpecific e = (EnvironmentSpecific) t; t = (ToolInstallation)e.forEnvironment(EnvVars.getRemote(channel)); } stdout.println(t.getHome()); return 0; }
/** * Performs an installation. */ private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException { Run b = p.getBuildByNumber(Integer.parseInt(id.number)); if (b == null) { throw new AbortException("No such build: " + id.number); } Executor exec = b.getExecutor(); if (exec == null) { throw new AbortException(b.getFullDisplayName() + " is not building"); } Node node = exec.getOwner().getNode(); if (t instanceof NodeSpecific) { NodeSpecific n = (NodeSpecific) t; t = (ToolInstallation) n.forNode(node, new StreamTaskListener(stderr)); } if (t instanceof EnvironmentSpecific) { EnvironmentSpecific e = (EnvironmentSpecific) t; t = (ToolInstallation) e.forEnvironment(EnvVars.getRemote(channel)); } stdout.println(t.getHome()); return 0; }