Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A simple way to reduce the number of jobs or job - chains for shell scripts is to use a generic job., job chain and orders:

code
Code Block
languagexml
titleExample Job (Windows)
  <job order="yes"
       stop_on_error="no"
       title="This job is a example showing the generic execution of a shell- script or a shell- command">
      <script language="shell">
          <![CDATA[
  '''echo %SCHEDULER_PARAM_SCRIPT2EXECUTE%'''
  '''%SCHEDULER_PARAM_SCRIPT2EXECUTE%'''
          ]]>
      </script>
      <run_time/>
  </job>

This job will execute a script or a command which name that is specfied with the parameter "Script2Execute".

Putting Adding this job in to a job chain like the one belowthis:

Code Block
languagexml
titleExample Job Chain
  <job_chain orders_recoverable="yes"
             visible="yes"
             title="ShellExecutor: generic Executionexecution of a shell- script or ashell command">
      <job_chain_node state="Step.100"
                      job="GenericShellExecutor"
                      next_state="success"
                      error_state="error"/>
      <job_chain_node state="success"/>
      <job_chain_node state="error"/>
  </job_chain>

will start this job every time an order for the chain is scheduled like this one:

Code Block
languagexml
titleExample for Job Chain
  <order>
      <params>
          <param name="Script2Execute"
                 '''value="dir c:\temp"/>'''
      </params>
      <run_time let_run="no"/>
  </order>

At the end, one have to create for each script/command to execute an additional order.