The Blue Ocean Pipeline Editor is the simplest way for anyone to get started with creating Pipelines in Jenkins. It’s also a great way for existing Jenkins users to start adopting Pipeline.
The editor allows users to create and edit Declarative Pipelines, add
stages and parallelized tasks that can run at the same time, depending on their
needs. When finished, the editor saves the Pipeline to a source code repository
Jenkinsfile. If the Pipeline needs to be changed again,
Blue Ocean makes it easy to jump back in into the visual editor to modify the
Pipeline at any time.
To use the editor a user must first have created a pipeline in Blue Ocean or have one or more existing Pipelines already created in Jenkins. If editing an existing pipeline, the credentials for that pipeline must allow pushing of changes to the target repository.
The editor can be launched via:
Dashboard "New Pipeline" button
Activity View for Single Run
Pipeline Run Details
SCM-based Declarative Pipelines only
Credentials must have write permission
Does not have full parity with Declarative Pipeline
Pipeline re-ordered and comments removed
By default, the right side of editor shows the "Pipeline Settings". This sheet can be accessed by clicking anywhere in the Stage editor that is not a Stage or one of the "Add Stage" buttons.
The "Agent" section controls what agent the Pipeline will use. This is the same as the "agent" directive.
The "Environment" sections lets us set environment variables for the Pipeline. This is the same as the "environment" directive.
The left side editor screen contains the Stage editor, used for creating the stages of a Pipeline.
Stages can be added to the Pipeline by clicking the "+" button to the right of an existing stage. Parallel stages can be added by clicking the "\+" button below an existing Stage. Stages can be deleted using the context menu in the stage configuration sheet.
The Stage editor will display the name of each Stage once it has been set. Stages that contain incomplete or invalid information will display a warning symbol. Pipelines can have validation errors while they are being edited, but cannot be saved until the errors are fixed.
Selecting a stage in the Stage editor will open the "Stage Configuration" sheet on the right side. Here we can can change the name of the Stage, delete the Stage, and add steps to the Stage.
The name of the Stage can be set at the top of the Stage Configuration sheet. The context menu (three dots on the upper right), can be used to delete the current stage. Clicking "Add step" will display the list of available Steps types with a search bar at the top. Steps can be deleted using the context context menu in the step configuration sheet. Adding a step or selecting an existing step will open the step configuration sheet.
Selecting a step from the Stage configuration sheet will open the Step Configuration sheet.
This sheet will differ depending on the step type, containing whatever fields or controls are needed. The name of the Step cannot be changed. The context menu (three dots on the upper right), can be used to delete the current step. Fields that contain incomplete or invalid information will display a warning symbol. Pipelines can have validation errors while they are being edited, but cannot be saved until the errors are fixed.
In order to be run, changes to a Pipeline must be saved in source control The "Save Pipeline" dialog controls saving of changes to source control.
A helpful description of the changes can be added or left blank. The dialog also supports saving changes the same branch or entering a new branch to save to. Clicking on "Save & run" will save any changes to the Pipeline as a new commit, will start a new Pipeline Run based on those changes, and will navigate to the Activity View for this pipeline.