Exporting from the command line
You can automate the generation of solution, agent, and shared aggregates archives by running the export from the command line.
If you want to automate the deployment process, you can export solution, agent, and shared aggregates archives without going through the user interface.
From the command line, you call the com.ibm.ia.designer.core.automation application that is provided with Insight Designer. You use arguments in the command line to specify the options of your export process. There are arguments to import the projects into the workspace, either from a root project or by specifying each project individually, and to specify the .esa archive path.
Command line syntax
The following syntax shows how to export a solution or agent archive from the command line. You indicate the path to your Eclipse executable file, and you specify the workspace in which you want to run Eclipse. If the projects are not in the Eclipse workspace, you specify the folder that contains the projects.
<path_to_eclipse> -data <workspace> -application com.ibm.ia.designer.core.automation -importRoot <root_folder> -exportSolution|-exportAgent <project_name> -esa <archive_name>.esa
The following syntax shows how to export a shared aggregates archive.
<path_to_eclipse> -data <workspace> -application com.ibm.ia.designer.core.automation -importRoot <root_folder> -exportSolution <project_name> -exportAggregates <regular_expression> -esa <archive_name>.esa
Command line arguments
The following table lists the arguments that you add to your command line to export the archives. You use these arguments in addition to the Eclipse runtime options.
| Argument | Description | Comments |
|---|---|---|
| -data <workspace> | Specify the workspace to run Eclipse. | Eclipse runtime option. |
| -application <automation_plugin> | Specify the automation plug-in com.ibm.ia.designer.core.automation. | Eclipse runtime option. |
| -clear | Clear the workspace before processing. | Optional. |
| -esa <archive_name>.esa | Specify the name and path to the .esa archive. | |
| -exportAgent <agent_project> | Specify the name of the agent project to be exported. | |
| -exportSolution <solution_project> | Specify the name of the solution project to be exported. | |
| -exportAggregates <regular_expression> | Specify the fully qualified names of the shared aggregates to be exported in the form of a regular expression. You can export one or more aggregates in the same expression. | Optional. You can use this argument several times in the same command
line. This argument requires the -exportSolution argument. |
| -help (-h) | Print usage information. | Optional. |
| -importPath <projects> | List the projects to import into the workspace. The list uses the File.separator system property. | Optional. You can use either -importPath or -importRoot to import the projects into the workspace. |
| -importRoot <root_folder> | Specify the folder that contains the projects that compose the solution to import them into the workspace. | Optional. You can use either -importPath or -importRoot to import the projects into the workspace. |
| -version <version_number> | Update the projects to this version, after export. If you export a solution, the version is <major>.<minor>. If you export an agent, the version is <major>.<minor>.<micro>. | Optional. If you do not specify the version, the manifest files are not changed. If you specify a version, the manifest files are updated with this version. |
| --launcher.suppressErrors | If there are errors, this argument prevents Eclipse error windows from displaying. The errors display directly in the console. | Optional. |
Example of command line to export a solution
In the following example, you import the root folder that contains the solution project and the projects that are referenced in the solution project. You export the mysolution project, and create a mysolution.esa archive.
eclipse -data tmpWorkspace -application com.ibm.ia.designer.core.automation -importRoot myprojects -exportSolution mysolution -esa mysolution.esa
Example of command line to export an agent
In the following example, the workspace contains the solution project and the projects that are referenced in the solution project. You export the myagent project, and create a myagent.esa archive with the version 1.1.3.
eclipse -data workspace -application com.ibm.ia.designer.core.automation -exportAgent myagent -version 1.1.3 -esa myagent.esa
Example of command line to export shared aggregates
In the following example, the workspace contains the solution project and the projects that are referenced in the solution project. You export all the shared aggregates in the mypackage/agg folder of the BOM of the mysolution project, and create a myaggregates.esa archive. The fully qualified names of these aggregates follow the structure mypackage.agg.Entity.sharedAggregate, so the regular expression that matches all these names is mypackage\.agg\.+.The resulting archive contains all the elements that are necessary to deploy the updated shared aggregates, including the agents that are related to these aggregates.
eclipse -data workspace -application com.ibm.ia.designer.core.automation -exportSolution mysolution -exportAggregates mypackage\.agg\.+ -esa myaggregates.esa --launcher.suppressErrors