/** * Gets the file used to store the initial admin password */ public FilePath getInitialAdminPasswordFile() { return Jenkins.get().getRootPath().child("secrets/initialAdminPassword"); }
/** * Binds /userContent/... to $JENKINS_HOME/userContent. */ public DirectoryBrowserSupport doUserContent() { return new DirectoryBrowserSupport(this,getRootPath().child("userContent"),"User content","folder.png",true); }
/** * Gets the file used to store the initial admin password */ public FilePath getInitialAdminPasswordFile() { return Jenkins.getInstance().getRootPath().child("secrets/initialAdminPassword"); }
/** * Binds /userContent/... to $JENKINS_HOME/userContent. */ public DirectoryBrowserSupport doUserContent() { return new DirectoryBrowserSupport(this,getRootPath().child("userContent"),"User content","folder.png",true); }
/** * Get the folder on master where user can put some packages to avoid * downloads when creating a VIRTUALENV. * * @return The packages folder * @throws IOException * @throws InterruptedException */ public FilePath getMasterPackagesDir() throws IOException, InterruptedException { return FilePathUtil.isDirectoryOrNull(Jenkins.getInstance().getRootPath().child(BASENAME).child(PACKAGES)); }
public Map<String, String> getEnvVarsPropertiesJobProperty(@Nonnull FilePath rootPath, @Nonnull EnvInjectLogger logger, boolean loadFilesFromMaster, @CheckForNull String propertiesFilePath, @CheckForNull Map<String, String> propertiesContent, @Nonnull Map<String, String> infraEnvVarsMaster, @Nonnull Map<String, String> infraEnvVarsNode) throws EnvInjectException { final Map<String, String> resultMap = new LinkedHashMap<String, String>(); try { if (loadFilesFromMaster) { // Even if the propertiesFilePath is null, we do not want to allow loading // from the master, because it may expose sensitive Environment Variables if (!EnvInjectPluginConfiguration.getOrFail().isEnableLoadingFromMaster()) { throw EnvInjectExceptionFormatter.forProhibitedLoadFromMaster(propertiesFilePath); } resultMap.putAll(Jenkins.getActiveInstance().getRootPath().act( new PropertiesVariablesRetriever( propertiesFilePath, propertiesContent, infraEnvVarsMaster, logger))); } else { resultMap.putAll(rootPath.act( new PropertiesVariablesRetriever( propertiesFilePath, propertiesContent, infraEnvVarsNode, logger))); } } catch (IOException e) { throw new EnvInjectException(e); } catch (InterruptedException e) { throw new EnvInjectException(e); } return resultMap; }
log.info("System script."); rootPath = Jenkins.getInstance().getRootPath(); } else { log.info("Script executed on node.");
@LocalData @Test public void testSlave() throws Exception { DumbSlave s = rule.createOnlineSlave(); project.setAssignedLabel(s.getSelfLabel()); FilePath src = new FilePath(rule.jenkins.getRootPath(), "jobs/" + BASIC_TEST_PROJECT + "/workspace/"); assertNotNull(src); FilePath dest = s.getWorkspaceFor(project); assertNotNull(dest); src.copyRecursiveTo("*.xml", dest); testBasic(); }
@RandomlyFails("TimeoutException from basic") @LocalData("All") @Test public void slave() throws Exception { DumbSlave s = j.createOnlineSlave(); project.setAssignedLabel(s.getSelfLabel()); FilePath src = new FilePath(j.jenkins.getRootPath(), "jobs/junit/workspace/"); assertNotNull(src); FilePath dest = s.getWorkspaceFor(project); assertNotNull(dest); src.copyRecursiveTo("*.xml", dest); basic(); }