Lesson 2: Creating a job and adding steps
A job is a series of steps that, together, complete an activity, such as building a project. When a project runs, the steps run one at a time in the order that you specify.
Creating a job
Most job steps are created from plug-ins. Plug-in steps can be thought of as distinct pieces of automation.
Create a job by completing these steps:
Cleaning the workspace
To ensure that no files from a previous build get incorporated into the new one, add a step to clean the agent's workspace. This step is part of most build jobs.
After a job has a step, the Create Step push button is no longer used and actions are used instead to insert steps.
Populating the workspace
This step places the checked-out code, which is defined later in the project's source configuration, in the agent's workspace.

Creating a stamp step
A stamp is an identifier that is applied to a build. Stamps are often used in addition to the automatically generated build life identifiers. A stamp step is part of most jobs.

Creating a get changelog step
This step retrieves source changes that were saved since the last build. The prior build life is located by using status or stamp parameters.

Creating an Ant build step
Create a step that runs an Ant build process.

Creating the publish JUnit tests step
JUnit is a testing framework for Java™. This step runs tests and reports the results.

Creating the upload artifacts step
Create a step that uploads the build artifacts into the artifact repository, CodeStation.
- Click the Insert After action for the Publish JUnit Report step.
- In the Steps dialog box, click , and then click Select.
-
In the Name field, type
Upload All Artifacts. - Accept the default values for the other fields and click Save.

Creating the step to upload artifacts to DevOps Deploy
Create a step to upload the build artifacts to IBM DevOps Deploy (Deploy).

Creating the component version status step
Create a step that sets the component version status in IBM DevOps Deploy (Deploy).
Success in Deploy, as described
in Configure the tutorial system.
Creating the assign success step
If all previous steps succeed, this step assigns a status of Success to the entire job. If the preceding steps fail, this step does not run, and the next step runs instead.

Creating the assign failure step
This step assigns a status of Failure to the job. The step runs if any of the preceding steps fail.
- Click the Insert After action for the Assign Success step.
- In the Steps dialog box, click Build, and then click Assign Status.
-
In the Name field, type
Assign Failure. - In the Status list, select Failure.
- Display the Pre-Condition Script list, and select Any Prior Failure.
- Click Save.
Lesson checkpoint
In this lesson, you created job and added steps to it.
This job retrieves source from GitHub and runs an Ant build process on it. It uploads the artifacts into IBM DevOps Deploy (Deploy) and generates JUnit test reports. Steps are configured individually as you insert them into a job.


