<< Back to previous view

[QB-3274] Export a configuration tree to a zip file
Created: 08/Oct/18  Updated: 09/Oct/18

Status: Closed
Project: QuickBuild
Component/s: None
Affects Version/s: 8.0.5
Fix Version/s: None

Type: Task Priority: Major
Reporter: Phong Trinh Assigned To: Robin Shen
Resolution: Fixed Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown
Environment: Linux


 Description   
 Hi Support Team,

  I would like to create a groovy script to export each of configurations under root to separate zip files. May you please provide an example on how to do that?

  Thank you in advance,
ptrinh

 Comments   
Comment by Robin Shen [ 08/Oct/18 11:54 PM ]
Please try below script:

groovy:
def rootConf = system.configurationManager.get("root");
for (eachConf in system.configurationManager.getChildren(rootConf)) {
  def exportOption = new com.pmease.quickbuild.util.ConfigurationExportOption();
  exportOption.configurationPath = eachConf.pathName;
  exportOption.recursive = true;
  com.pmease.quickbuild.entitymanager.DataManager.instance.exportConfigurations(exportOption, new File("/path/to/export.zip"));
}
Comment by Phong Trinh [ 09/Oct/18 05:07 PM ]
 It works for me. Thank you very much, Robin. I really appreciate it.
Generated at Fri Apr 19 04:36:40 UTC 2024 using JIRA 189.