PageRenderTime 65ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/jgitflow-maven-plugin/src/it/projects/hotfix-finish-with-release-branch/prebuild.groovy

https://bitbucket.org/atlassian/jgit-flow
Groovy | 18 lines | 13 code | 5 blank | 0 comment | 0 complexity | 00a5dffa3e348f3cad2de48c89c4ebb2 MD5 | raw file
Possible License(s): Apache-2.0
  1. import com.atlassian.maven.plugins.jgitflow.it.FinishScriptHelper
  2. import org.apache.commons.io.FileUtils
  3. import org.eclipse.jgit.api.CreateBranchCommand
  4. helper = new FinishScriptHelper(basedir, localRepositoryPath, context)
  5. gits = helper.createAndCloneRepo("1.0","1.1-SNAPSHOT","1.0.1","hotfix/")
  6. helper.cloneDevelopRepo("1.1-SNAPSHOT","1.1","release/")
  7. localGit = gits.local;
  8. localGit.checkout().setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK).setCreateBranch(true).setStartPoint("origin/hotfix/1.0.1").setName("hotfix/1.0.1").call();
  9. File junkFile = new File(localGit.getRepository().getWorkTree(), "junk.txt");
  10. FileUtils.writeStringToFile(junkFile, "I am junk");
  11. localGit.add().addFilepattern(junkFile.getName()).call();
  12. localGit.commit().setMessage("adding junk file").call();
  13. return true;