use of io.fabric8.git.internal.DefaultPullPushPolicy in project fabric8 by jboss-fuse.
the class PushPullPolicyIT method initLocalGitRepositoryAndPushToServletRepository.
@Before
public void initLocalGitRepositoryAndPushToServletRepository() throws Exception {
dirLocal = new File("target/data-local");
dirServlet = new File("target/data-servlet");
FileUtils.deleteDirectory(dirLocal);
FileUtils.deleteDirectory(dirServlet);
local = Git.init().setDirectory(dirLocal).setGitDir(new File(dirLocal, ".git")).call();
servlet = Git.init().setDirectory(dirServlet).setBare(true).call();
// local -> servlet
local.getRepository().getConfig().setString("remote", "origin", "url", dirServlet.getCanonicalPath());
local.getRepository().getConfig().setString("remote", "origin", "fetch", "+refs/heads/*:refs/remotes/origin/*");
local.getRepository().getConfig().save();
// master branch - ensemble profiles
prepareMasterBranch();
// version 1.0 - created by importing initial profiles
prepare10Branch();
prepareBranch("1.0.1", "1.0", 3);
prepareBranch("1.1", "1.0", 4);
prepareBranch("1.2", "1.1", 2);
local.push().setRemote("origin").setPushAll().setPushTags().call();
policy = new DefaultPullPushPolicy(local, "origin", 42);
}
Aggregations