Skip to content

Create a Pipeline by Jenkinsfile

Workbench Pipelines allows you to create pipelines by Jenkinsfile stored in a repository.

Prerequisites

Steps

  1. Click Create Pipeline on the pipeline list page.

    Create Pipeline

  2. Choose Create a pipeline by Jenkinsfile and click OK .

    Create by Jenkinsfile

  3. Fill in the basic information and repository details as per the instructions below.

    • Name: the name of the pipeline. The pipeline name must be unique within the same workspace.
    • Repo URL: Provide the URL of the remote code repository.
    • Credential: For private repositories, you need to create repository access credentials in advance and select the credential here.
    • Branches: The branch of the code that the pipeline will be built from, by default the master branch is selected.
    • Script Path: The absolute path of the Jenkinsfile within the code repository.

    Basic Info

  4. Input the build settings and build parameters as per the instructions below.

    • Delete expired pipelines: Remove previous build records to conserve Jenkins disk space.

      • Retention days for builds: Define how many days of build records are to be kept. The default value is 7 days, meaning that build records older than seven days will be removed.
      • Maximum builds: Set a maximum limit for the number of build records to be kept. The default value is 10. When there are more than 10 records, the oldest ones get deleted first.
      • Both Retention days and Maximum builds rules apply simultaneously. Records are deleted as soon as either condition is met.
    • Disable concurrent builds: When this option is enabled, only one pipeline build task can be executed at a time.

    • Build Parameters: Input one or more build parameters when initiating the pipeline. Five default parameter types are provided: Boolean, String, Multiline String, Options, Password, and Upload files.
    • After adding build parameters, you'll need to provide the corresponding value for each parameter when running the pipeline.

    Parameters

  5. Set up the build trigger as per the instructions below.

    • Code source triggered: When this option is enabled, the system will periodically scan the specific branch in the code repository used for the pipeline build according to the Regular Repo Scan , and rerun the pipeline if there are any updates.
    • Scheduled repository scanning: Input a CRON expression to define the time intervals for scanning the repository. After entering the expression, its meaning will be displayed at the bottom. For detailed syntax rules of the expression, refer to Cron Schedule Syntax.
    • Scheduled trigger: This will trigger the pipeline build at the specified time, regardless of whether the code repository has been updated or not.

    Build Trigger

  6. Complete the creation. After ensuring all parameters are filled in, click the OK button to finalize the creation of the custom pipeline. You'll be automatically redirected to the pipeline list. Click to the right of the list to perform various actions.

    Edit

Comments