Configuring the Pipeline project by using the script from SCM

You can configure the Pipeline project to use the pipeline script from the Source Code Management (SCM), and then run test assets from the Jenkins Pipeline project.

Before you begin

You must have completed the following tasks:

  • Installed the DTUI-UITest-Jenkins-HCL plugin on the Jenkins primary server. See Installing the plugin on the Jenkins primary server.

  • Created an Agent in Jenkins. For more information about creating Agents, refer to the Jenkins documentation.

  • Copied the name of the labels that you provided in the Labels field when you created the Agent.

  • Created a pipeline script and committed the script to the Git repository. For more information, refer to the Jenkins documentation.

  • Been granted administrator permission of the Jenkins server to add credentials into Jenkins.

  • Added your GitHub credentials into Jenkins. For more information about adding global credentials, refer to the Jenkins documentation.

  • Created a Jenkins Pipeline project.

About this task

If your pipeline scripts are complex, you can then write the script outside of Jenkins UI. You must commit that script file into your Git repository. During the Pipeline build process, Jenkins checks out the script file from the Git repository and runs your Pipeline project.

Procedure

  1. Open your Jenkins Pipeline project from the list.
  2. Click Configure, and then select the Pipeline tab.
  3. Select the Pipeline script from SCM option in the Definition field.
  4. Select the Git option from the drop-down list in the SCM field.
  5. Enter the URL of the Git repository in the Repository URL field where you stored your pipeline script.
  6. Select the credentials of the Git repository from the drop-down list.
  7. Optional: Enter the branch name of the Git repository in the Branch Specifier field.
  8. Enter the path of the script that you stored in the Git repository in the Script path field.
  9. Click Save.

Results

You have configured the Pipeline project by using the Pipeline script from the SCM option.

What to do next

You can run test assets from the Jenkins server. See Running tests from Jenkins.