Skip to content

Create pipeline based on Jenkinsfile

Workbench Pipelines supports creating pipelines using a Jenkinsfile in a repository.

Prerequisites

The specific operation steps are as follows:

  1. Click Create Pipeline on the pipeline list page.

  2. Select Create a pipeline based on the Jenkinsfile of the code base and click OK.

  3. Fill in the basic information and code warehouse information by referring to the instructions below.

    • name: the name of the pipeline. The pipeline name must be unique under the same workspace.
    • Code warehouse address: fill in the address of the remote code warehouse.
    • Credentials: For private repositories, you need to Create Repository Access Credentials in advance and select the credential here.
    • Branch: Based on the code of which branch to build the pipeline, the default is the master branch.
    • Script path: the absolute path of the Jenkinsfile in the code repository.

  4. Fill in the build settings and build parameters with reference to the instructions below.

    • Delete expired pipeline records: Delete previous build records to save disk space used by Jenkins.

      • Build record retention period: Up to several days of build records are kept, the default value is 7 days, that is, build records older than seven days will be deleted. -Maximum number of build records: keep a maximum number of build records, the default value is 10, that is, keep a maximum of 10 records. When there are more than 10 records, the oldest records are deleted first.
      • The two rules retention period and maximum number are in effect at the same time, as long as one of them is met, the records will be deleted.
    • Do not allow concurrent builds: When enabled, only one pipeline build task can be executed at a time.

    • Build Parameters: Pass in one or more build parameters when starting to run the pipeline. Five parameter types are provided by default: Boolean, string, multiline text, options, password, upload file.
    • After adding build parameters, you need to enter the corresponding value for each build parameter when running the pipeline.

  5. Fill in the build trigger by referring to the instructions below.

    • Code source trigger: After it is turned on, the system will periodically scan the specific branch in the warehouse code used to build the pipeline according to the timed warehouse scan plan, and re-run the pipeline if there is an update.
    • Scheduled warehouse scan schedule: Enter a CRON expression to define the time period for scanning warehouses. After entering the expression, the meaning of the current expression will be prompted at the bottom. For detailed expression syntax rules, please refer to Cron Schedule Syntax.
    • Timing trigger: Timing triggers the construction pipeline, no matter whether the code warehouse is updated or not, the pipeline will be re-run at the specified time.

  6. Complete the creation. After confirming that all parameters have been entered, click the OK button to complete the creation of the custom pipeline and automatically return to the pipeline list. Click to the right of the list to perform various actions.

Comments