Search in sources :

Example 1 with GitConfig

use of org.commonjava.indy.subsys.git.GitConfig in project indy by Commonjava.

the class RevisionsManager method setup.

@PostConstruct
public void setup() {
    try {
        final File dataDir = dataFileManager.getDetachedDataBasedir();
        final File gitignore = new File(dataDir, ".gitignore");
        dataDir.mkdirs();
        FileUtils.write(gitignore, join(DATA_DIR_GITIGNORES, "\n"));
        final GitConfig dataConf = new GitConfig(dataDir, revisionsConfig.getDataUpstreamUrl(), true).setRemoteBranchName(revisionsConfig.getBranchName()).setUserEmail(revisionsConfig.getUserEmail());
        dataFileGit = new GitManager(dataConf);
    } catch (GitSubsystemException | IOException e) {
        throw new IllegalStateException("Failed to start revisions manager: " + e.getMessage(), e);
    } finally {
    }
}
Also used : GitManager(org.commonjava.indy.subsys.git.GitManager) GitConfig(org.commonjava.indy.subsys.git.GitConfig) GitSubsystemException(org.commonjava.indy.subsys.git.GitSubsystemException) IOException(java.io.IOException) DataFile(org.commonjava.indy.subsys.datafile.DataFile) File(java.io.File) PostConstruct(javax.annotation.PostConstruct)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 PostConstruct (javax.annotation.PostConstruct)1 DataFile (org.commonjava.indy.subsys.datafile.DataFile)1 GitConfig (org.commonjava.indy.subsys.git.GitConfig)1 GitManager (org.commonjava.indy.subsys.git.GitManager)1 GitSubsystemException (org.commonjava.indy.subsys.git.GitSubsystemException)1