Name

exec — executes commands in an external command processor

Synopsis

Content Model

	    <exec> = <script>?
	    

Attributes

NameTypeDefault
filethe name of the file containing the code to be executed by the interpreter Optional
interpreterthe name of the command processor that will execute the specified code Required

Description

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.

Parents

These elements contain exec: ForestModel, repeat.

Children

The script code may be included as text within an enclosed script element.

Attributes

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.

Examples

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>