Scope of Execution of Import CLI Script
Sometimes, you might not want to run import from the top-level 'build.xml1'. For example, if you want to create all the environments and not the hosts or other Global objects like Resource templates.
>ant -f build.xml <"targetName"> (where targetName could be "create" , "start" or "clean" )
Exported data files are laid out in way that allow you to this. In the example directory structure shown below, notice that under the top level folder "Environments" you have one more 'build.xml2'. You can run import from this build file (level) and in that case it only processes all environments found under "Environments" folder.
>ant -f Environments/build.xml <"targetName"> (where targetName could be "create" , "start", or "clean")
Similarly, let us say, you want to create the DevEnvironment and its Nodes and Application and not create TestEnv environment in the below example. Under Environments/DevEnvironment, a 'env_build.xml3' file exists. You can start the import from there and it only processes the DevEnvironment and its node and Applications.
>ant -f Environments/DevEnvironment/env_build.xml <"targetName"> (where targetName could be "create" , "start", or "clean" )
Similarly, let us say, you want to create all the nodes of DevEnvironment and not its applications. Under Environments/DevEnvironment/Nodes, a 'build.xml4' file exists. You can start the import from there and it only creates nodes provided that the DevEnvironment is already present in the target AMX Admin.
>ant -f Environments/DevEnvironment/Nodes/build.xml <"targetName"> (where targetName could be "create" , "start", or "clean" )
The same applies for ' build.xml5' that allows you to only create Applications for DevEnvironment, provided it exists in the target AMX Admin.
For some AMX Objects, you can just run '1_MyApp.app_build.xml6' build file and it creates the application.
- As rule of thumb, if you see any *build.xml file under the exported data folder, you should be able to run it. All these files have the same three targets discussed earlier - “create”, “start”, and “clean”.
- Even though you can run any *build.xml, it does not guarantee that it will complete successfully. You can create nodes provided that the Environment they belong to exists on the target AMX Enterprise. The same applies for application creation but it assumes that the Environment, Node, DAA that are needed for the application already exist on the Environment. If not, creation fails. Instead, if you run the top level build.xml1, all the pre-requisites are created before the Node or application is created.