KBEC-00265 - Running an External Job Step – using createJob and createJobStep

Article ID:360032828712
1 minute readKnowledge base
On this page

Problem

What is the difference between the createJob and createJobStep commands in ectool? How are they used within CloudBees CD (CloudBees Flow)?

Solution

createJobStep is used to create dynamic steps

ectool createJobStep --parallel 1 --projectName Default --subprocedure coolProcedure --actualParameter input=helloWorld

createJob is used to report in CloudBees CD (CloudBees Flow) about external jobs, usually in conjunction with a grid engine like LSF. The createJob command creates a job within CloudBees CD (CloudBees Flow) that tracks something that runs completely outside of CloudBees CD (CloudBees Flow) (perhaps some type of QA tests as an example).

ectool createJob --projectName "Sample Project" --status running

After you set the status to Running, the step is effectively running. A job step will only be marked completed when the completeJobStep API is called on the step and any child steps have completed. The job’s completion is similarly dependent on the completeJob API being called.

  1. If you want to run something from the command field in a step created with createJobStep, you must not specify the --external option on your createJobStep command because that will assume that it’s an external command and will not execute the commands in the command field.

  2. You cannot use createJobStep in combination with createJob because createJob assumes an external command, so the steps created in that job are not executed.

  3. createJobStep commands are dynamic commands that can be created from a procedure to run in an existing CloudBees CD (CloudBees Flow) job (not an external job created with createJob as previously stated).