Create a custom pipeline¶
Workbench pipeline supports custom creation, and you can visually arrange the pipeline through the pipeline created in this way.
prerequisites¶
- Create Workspace, Create User.
- Add the user to the workspace with
workspace editor
or higher privileges.
Steps¶
The specific operation steps are as follows:
-
Click
Create Pipeline
on the pipeline list page. -
In the pop-up dialog box, select Custom Create Pipeline and click OK.
-
Fill in
Basic Information
,Build Settings
, andBuild Parameters
by referring to the following instructions.- name: the name of the pipeline. The pipeline name must be unique under the same workspace.
-
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
andmaximum 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.
-
Fill in the trigger parameters by referring to the following instructions.
- 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.
- 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
-
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.
Warning
- After a custom pipeline is created, the stages of the pipeline need to be manually defined (i.e. edit the pipeline) before the pipeline can be run. If you define the process and run the pipeline directly, there will be a
build failed
error. - If you create a pipeline based on a template or create a pipeline based on a Jenkinsfile, you can run it directly without manually editing the pipeline.
Next step: edit pipeline