summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.moxie2
-rw-r--r--releases.moxie2
-rw-r--r--src/main/distrib/federation.properties2
-rw-r--r--src/main/java/com/gitblit/FederationClient.java20
-rw-r--r--src/main/java/com/gitblit/FederationPullExecutor.java2
5 files changed, 20 insertions, 8 deletions
diff --git a/build.moxie b/build.moxie
index 97ade860..fe938a39 100644
--- a/build.moxie
+++ b/build.moxie
@@ -121,7 +121,7 @@ dependencies:
# Standard dependencies
- compile 'com.beust:jcommander:1.17' :fedclient :authority
- compile 'log4j:log4j:1.2.17' :war :fedclient :authority
-- compile 'org.slf4j:slf4j-api:1.6.6' :war fedclient :authority
+- compile 'org.slf4j:slf4j-api:1.6.6' :war :fedclient :authority
- compile 'org.slf4j:slf4j-log4j12:1.6.6' :war :fedclient :authority
- compile 'javax.mail:mail:1.4.3' :war :fedclient :authority
- compile 'javax.servlet:javax.servlet-api:3.0.1' :fedclient
diff --git a/releases.moxie b/releases.moxie
index cd21ab91..8dac1dcb 100644
--- a/releases.moxie
+++ b/releases.moxie
@@ -14,11 +14,13 @@ r17: {
- Fixed incorrect icon file name for .doc files (issue 200)
- Do not queue emails with no recipients (issue 201)
- Disable view and blame links for deleted blobs (issue 216)
+ - Fixed NPE in 1.2.1 Federation Client (issue 219)
- Fixed extracting Groovy scripts on Express installs (issue 220)
- Ensure Redmine url is properly formatted (issue 223)
- Use standard ServletRequestWrapper instead of custom wrapper (issue 224)
additions:
+ - Support --baseFolder parameter in Federation Client
- Optional periodic LDAP user and team pre-fetching & synchronization
- Display name and version in Tomcat Manager
- FogBugz post-receive hook script
diff --git a/src/main/distrib/federation.properties b/src/main/distrib/federation.properties
index c762b45c..72058f06 100644
--- a/src/main/distrib/federation.properties
+++ b/src/main/distrib/federation.properties
@@ -8,7 +8,7 @@
#
# SINCE 0.5.0
# RESTART REQUIRED
-git.repositoriesFolder = git
+git.repositoriesFolder = ${baseFolder}/git
# Search the repositories folder subfolders for other repositories.
# Repositories MAY NOT be nested (i.e. one repository within another)
diff --git a/src/main/java/com/gitblit/FederationClient.java b/src/main/java/com/gitblit/FederationClient.java
index 4aeb2111..d34aadbd 100644
--- a/src/main/java/com/gitblit/FederationClient.java
+++ b/src/main/java/com/gitblit/FederationClient.java
@@ -44,7 +44,16 @@ public class FederationClient {
usage(jc, t);
}
- IStoredSettings settings = new FileSettings(params.registrationsFile);
+ System.out.println("Gitblit Federation Client v" + Constants.getVersion() + " (" + Constants.getBuildDate() + ")");
+
+ // command-line specified base folder
+ File baseFolder = new File(System.getProperty("user.dir"));
+ if (!StringUtils.isEmpty(params.baseFolder)) {
+ baseFolder = new File(params.baseFolder);
+ }
+
+ File regFile = com.gitblit.utils.FileUtils.resolveParameter(Constants.baseFolder$, baseFolder, params.registrationsFile);
+ IStoredSettings settings = new FileSettings(regFile.getAbsolutePath());
List<FederationModel> registrations = new ArrayList<FederationModel>();
if (StringUtils.isEmpty(params.url)) {
registrations.addAll(FederationUtils.getFederationRegistrations(settings));
@@ -67,8 +76,6 @@ public class FederationClient {
System.exit(0);
}
- System.out.println("Gitblit Federation Client v" + Constants.getVersion() + " (" + Constants.getBuildDate() + ")");
-
// command-line specified repositories folder
if (!StringUtils.isEmpty(params.repositoriesFolder)) {
settings.overrideSetting(Keys.git.repositoriesFolder, new File(
@@ -76,7 +83,7 @@ public class FederationClient {
}
// configure the Gitblit singleton for minimal, non-server operation
- GitBlit.self().configureContext(settings, null, false);
+ GitBlit.self().configureContext(settings, baseFolder, false);
FederationPullExecutor executor = new FederationPullExecutor(registrations, params.isDaemon);
executor.run();
if (!params.isDaemon) {
@@ -106,7 +113,7 @@ public class FederationClient {
private static class Params {
@Parameter(names = { "--registrations" }, description = "Gitblit Federation Registrations File", required = false)
- public String registrationsFile = "federation.properties";
+ public String registrationsFile = "${baseFolder}/federation.properties";
@Parameter(names = { "--daemon" }, description = "Runs in daemon mode to schedule and pull repositories", required = false)
public boolean isDaemon;
@@ -126,6 +133,9 @@ public class FederationClient {
@Parameter(names = { "--frequency" }, description = "Period to wait between pull attempts (requires --daemon)", required = false)
public String frequency = "60 mins";
+ @Parameter(names = { "--baseFolder" }, description = "Base folder for received data", required = false)
+ public String baseFolder;
+
@Parameter(names = { "--repositoriesFolder" }, description = "Destination folder for cloned repositories", required = false)
public String repositoriesFolder;
diff --git a/src/main/java/com/gitblit/FederationPullExecutor.java b/src/main/java/com/gitblit/FederationPullExecutor.java
index ad1022cf..25cd32a5 100644
--- a/src/main/java/com/gitblit/FederationPullExecutor.java
+++ b/src/main/java/com/gitblit/FederationPullExecutor.java
@@ -153,7 +153,7 @@ public class FederationPullExecutor implements Runnable {
c, registrationFolder, registration.name));
return;
}
- File repositoriesFolder = new File(GitBlit.getString(Keys.git.repositoriesFolder, "git"));
+ File repositoriesFolder = GitBlit.getRepositoriesFolder();
File registrationFolderFile = new File(repositoriesFolder, registrationFolder);
registrationFolderFile.mkdirs();