本文整理了Java中jenkins.model.Jenkins.getRootDir()
方法的一些代码示例,展示了Jenkins.getRootDir()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.getRootDir()
方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:getRootDir
暂无
代码示例来源:origin: jenkinsci/jenkins
public String getCommand() {
return RunIdMigrator.getUnmigrationCommandLine(Jenkins.getInstance().getRootDir());
}
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Returns {@code true} if and only if the list of nodes is stored in the legacy location.
*
* @return {@code true} if and only if the list of nodes is stored in the legacy location.
*/
public boolean isLegacy() {
return !new File(jenkins.getRootDir(), "nodes").isDirectory();
}
}
代码示例来源:origin: jenkinsci/jenkins
private File getSecretKeyFile() {
return new File(Jenkins.getInstance().getRootDir(),"secret.key");
}
代码示例来源:origin: jenkinsci/jenkins
public DefaultConfidentialStore() throws IOException, InterruptedException {
this(new File(Jenkins.getInstance().getRootDir(),"secrets"));
}
代码示例来源:origin: jenkinsci/jenkins
@Nonnull
private File getMasterKillSwitchFile(@Nonnull Jenkins jenkins) {
return new File(jenkins.getRootDir(),"secrets/slave-to-master-security-kill-switch");
}
代码示例来源:origin: jenkinsci/jenkins
public DoubleLaunchChecker() {
home = Jenkins.getInstance().getRootDir();
}
代码示例来源:origin: jenkinsci/jenkins
static File getInstallingPluginsFile() {
return new File(Jenkins.getInstance().getRootDir(), "jenkins.install.InstallUtil.installingPlugins");
}
代码示例来源:origin: jenkinsci/jenkins
private File getRootDirFor(String name) {
return new File(new File(getRootDir(),"jobs"), name);
}
代码示例来源:origin: jenkinsci/jenkins
@Restricted(NoExternalUse.class)
public static String expandVariablesForDirectory(String base, String itemFullName, String itemRootDir) {
return Util.replaceMacro(base, ImmutableMap.of(
"JENKINS_HOME", Jenkins.getInstance().getRootDir().getPath(),
"ITEM_ROOTDIR", itemRootDir,
"ITEM_FULLNAME", itemFullName, // legacy, deprecated
"ITEM_FULL_NAME", itemFullName.replace(':','$'))); // safe, see JENKINS-12251
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Returns true if there's some data in the fingerprint database.
*/
public boolean isReady() {
return new File(Jenkins.getInstance().getRootDir(),"fingerprints").exists();
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Returns the directory that the nodes are stored in.
*
* @return the directory that the nodes are stored in.
* @throws IOException
*/
private File getNodesDir() throws IOException {
final File nodesDir = new File(jenkins.getRootDir(), "nodes");
if (!nodesDir.isDirectory() && !nodesDir.mkdirs()) {
throw new IOException(String.format("Could not mkdirs %s", nodesDir));
}
return nodesDir;
}
代码示例来源:origin: jenkinsci/jenkins
protected void doRun() {
long free = Jenkins.getInstance().getRootDir().getUsableSpace();
long total = Jenkins.getInstance().getRootDir().getTotalSpace();
if(free<=0 || total<=0) {
// information unavailable. pointless to try.
LOGGER.info("JENKINS_HOME disk usage information isn't available. aborting to monitor");
cancel();
return;
}
LOGGER.fine("Monitoring disk usage of JENKINS_HOME. total="+total+" free="+free);
// if it's more than 90% full and less than the minimum, activate
// it's AND and not OR so that small Hudson home won't get a warning,
// and similarly, if you have a 1TB disk, you don't get a warning when you still have 100GB to go.
HudsonHomeDiskUsageMonitor.get().activated = (total/free>10 && free< FREE_SPACE_THRESHOLD);
}
代码示例来源:origin: jenkinsci/jenkins
static File configDir() {
return new File(Jenkins.getInstance().getRootDir(), "log");
}
代码示例来源:origin: jenkinsci/jenkins
/**
* File that captures the state of upgrade.
*
* This file records the version number that the installation has upgraded to.
*/
/*package*/ static File getUpdateStateFile() {
return new File(Jenkins.get().getRootDir(),"jenkins.install.UpgradeWizard.state");
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Relocate log files in the old location to the new location.
*
* Files were used to be $JENKINS_ROOT/slave-NAME.log (and .1, .2, ...)
* but now they are at $JENKINS_ROOT/logs/slaves/NAME/slave.log (and .1, .2, ...)
*
* @see #getLogFile()
*/
@Initializer
public static void relocateOldLogs() {
relocateOldLogs(Jenkins.getInstance().getRootDir());
}
代码示例来源:origin: jenkinsci/jenkins
static File getConfigFile() {
return new File(Jenkins.getInstance().getRootDir(), "config.xml");
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets the directory where Hudson stores user information.
*/
static File getRootDir() {
return new File(Jenkins.get().getRootDir(), "users");
}
代码示例来源:origin: jenkinsci/jenkins
@Override
protected FilePathRule parse(String line) {
line = line.trim();
if (line.isEmpty()) return null;
line = line.replace("<BUILDDIR>","<JOBDIR>/builds/<BUILDID>");
line = line.replace("<BUILDID>","(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]_[0-9][0-9]-[0-9][0-9]-[0-9][0-9]|[0-9]+)");
line = line.replace("<JOBDIR>","<JENKINS_HOME>/jobs/.+");
line = line.replace("<JENKINS_HOME>","\\Q"+Jenkins.getInstance().getRootDir().getPath()+"\\E");
// config file is always /-separated even on Windows, so bring it back to \-separation.
// This is done in the context of regex, so it has to be \\, which means in the source code it is \\\\
if (isWindows()) line = line.replace("/","\\\\");
Matcher m = PARSER.matcher(line);
if (!m.matches())
throw new Failure("Invalid filter rule line: "+line);
try {
return new FilePathRule(
Pattern.compile(m.group(3)),
createOpMatcher(m.group(2)),
m.group(1).equals("allow"));
} catch (Exception e) {
throw new Failure("Invalid filter rule line: "+line+"\n"+ Functions.printThrowable(e));
}
}
代码示例来源:origin: jenkinsci/jenkins
static File getLastExecVersionFile() {
return new File(Jenkins.getInstance().getRootDir(), "jenkins.install.InstallUtil.lastExecVersion");
}
代码示例来源:origin: jenkinsci/jenkins
/*package*/ File getXMLQueueFile() {
return new File(Jenkins.get().getRootDir(), "queue.xml");
}
内容来源于网络,如有侵权,请联系作者删除!