exec
<exec> = <script>?
Name | Type | Default |
---|---|---|
file | the name of the file containing the code to be executed by the interpreter | Optional |
interpreter | the name of the command processor that will execute the specified code | Required |
The <exec> element invokes an external command processor to execute the specified code. This may be used, for example, to resolve external dependencies before the matrix building process begins, perhaps by pre-processing or downloading required files.
The execution context uses the directory containing the ForestModel xml file as the working directory.
These elements contain exec: ForestModel, repeat.
The script code may be included as text within an enclosed script element.
file
(Optional) A file name containing the code that should be executed by the specified interpreter. The file location is resolved relative to the input ForestModel xml file. If the file is not specified then the code to be executed must be included in an enclosed <script> element.
interpreter
A string literal identifying the command processor to be
used. Three options are supported at this time:
cmd
refers to the windows command processor,
powershell
refers to the powershell command
processor, and beanshell
refers to the BeanShell
interpreter.
Example 1
In this example the windows command processor is used to execute the rsync command to ensure that the latest copies of the required files prior to beginning to assemble the input matrix. The script to run is provided with the enclosed <script> element.
<exec interpreter="cmd"> <script> rsync -av cloud_server:/project1/yield_files/version_2 ./yield_files/version_2 </script> </exec>