History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-3274
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Robin Shen
Reporter: Phong Trinh
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Export a configuration tree to a zip file

Created: 08/Oct/18 01:56 AM   Updated: 09/Oct/18 05:07 PM
Component/s: None
Affects Version/s: 8.0.5
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Linux


 Description  « Hide
 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

 All   Comments   Work Log   Change History      Sort Order:
Phong Trinh [09/Oct/18 05:07 PM]
 It works for me. Thank you very much, Robin. I really appreciate it.

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"));
}