{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":32175,"path":"it-service-management/devops-change-velocity/model-jenkins-pipeline-dev-ops.md","title":"Model a Jenkins pipeline in DevOps","bundle":null,"doc_type":null,"release":"australia","body":"\n# Model a Jenkins pipeline in DevOps\n\nModel a Jenkins pipeline by mapping the pipeline to an app, and mapping DevOps pipeline steps to Jenkins stages.\n\n## Before you begin\n\nThe Jenkins plugin for ServiceNow DevOps is provided to enable change acceleration so your orchestration tool can communicate with ServiceNow DevOps and control certain aspects of pipeline executions.\n\nInstall the plugin from the Jenkins Marketplace. Navigate to **Manage Jenkins &gt; System configuration &gt; Plugins** in your Jenkins instance. Search for **ServiceNow DevOps Plugin** and select it, and then select **Install**.\n\nEnsure that your Jenkins tool is connected and configured. For more information, see [Onboard Jenkins to DevOps Change Velocity — Workspace](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/devops-change-velocity/onboard-jenkins-to-devops-change-velocity-workspace.md).\n\nRole required: sn\\_devops.admin\n\n## About this task\n\nBoth [scripted pipelines](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/devops-change-velocity/dev-ops-scripted-pipeline.md) \\(Jenkinsfile\\) and freestyle jobs are supported.\n\nFor Jenkinsfile pipelines, pipeline steps are created, mapped, and associated to orchestration tasks automatically, instead of manually.\n\n## Procedure\n\n1.  Map your pipeline to an app in DevOps.\n\n    1.  Navigate to **DevOps** &gt; **Apps &amp; Pipelines** &gt; **Apps** and open the application record to associate with the pipeline.\n\n    2.  In the Pipelines related list, click **Edit...** to select a pipeline to associate with the app, or click **New** to create the pipeline.\n\n        For a new pipeline, fill in the **Orchestration pipeline** field using the full project name as specified in Jenkins.\n\n        **Note:** While associating a pipeline with an app, the pipeline steps are also fetched during import.\n\n    3.  Click **Submit**.\n\n2.  Open the pipeline record again and select the **Track** check box so events from the pipeline are received.\n\n    **Note:** The **Track** check box must be selected to integrate the pipeline with DevOps.\n\n3.  Create DevOps steps automatically or manually to map to each Jenkins pipeline stage so an orchestration task is created.\n\n    -   For declarative or scripted pipelines, run your Jenkins pipeline to automatically create and map pipeline steps in DevOps.\n\n        Pipeline steps are automatically created, mapped, and associated when DevOps receives step notifications from your Jenkins pipeline during the run.\n\n    -   For freestyle jobs, manually create and map each pipeline step to a Jenkins pipeline job.\n\n        In the Steps related list, click **New** to create a DevOps step for each Jenkins pipeline stage \\(**Orchestration stage** field\\)\n\n        **Note:** The **Orchestration stage** field value of each step is case-sensitive and must match the original name of the corresponding Jenkins pipeline stage.\n\n<table id=\"table_gcg_z4f_gnb\"><tbody><tr><td>\n\nName\n\n</td><td>\n\nName of the pipeline step.\n\n</td></tr><tr><td>\n\nPipeline\n\n</td><td>\n\nPipeline in which the step is configured.\n\n</td></tr><tr><td>\n\nType\n\n</td><td>\n\nPipeline step type.-   Build and Test\n-   Test\n-   Deploy\n-   Deploy and Test\n-   Manual\n-   Prod Deploy\n\n\n</td></tr><tr><td>\n\nOrder\n\n</td><td>\n\nOrder in which the steps are run.\n\n **Note:** The step order determines the order of the cards in the [Pipeline UI](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/devops-change-velocity/dev-ops-pipeline-ui.md).\n\nThe order of the cards in the Pipeline UI is by task execution.\n\n</td></tr><tr><td>\n\nOrchestration stage\n\n</td><td>\n\nJenkins pipeline stage name \\(case-sensitive\\).\n\n **Note:** For step association with Jenkins pipeline stages, the **Orchestration stage** field must be configured.\n\n</td></tr><tr><td>\n\nBusiness service\n\n</td><td>\n\nConfiguration service that applies to the step.\n\n</td></tr></tbody>\n</table>        Once orchestration tasks are created, associate each orchestration task in the Orchestration Tasks related list with a DevOps pipeline step.\n\n4.  Enable change control automatically or manually based on the type of pipeline.\n\n    -   For declarative or scripted pipelines, if you have used the snDevOpsChange script in your pipeline, run your Jenkins pipeline to automatically enable change control. You can also enable change control manually by following the steps provided for freestyle jobs.\n    -   For freestyle jobs, select the **Change control** check box in a step to enable [change acceleration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/devops-change-velocity/dev-ops-change-acceleration.md) and the corresponding configuration fields.\n\n        **Note:** ServiceNow [Change Management](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/change-management/c_ITILChangeManagement.md) must be installed for change acceleration.\n\n<table id=\"table_xm1_tdf_llb\"><tbody><tr><td>\n\nChange receipt\n\n</td><td>\n\nSelect to enable change receipt for the step so the pipeline doesn't pause when a change request is created.\n\n All pipeline data is included in the change, but approval is not required for the pipeline to proceed.\n\n</td></tr><tr><td>\n\nChange approval group\n\n</td><td>\n\nApproval group for the change request.\n\n The change approval group becomes the **Assignment group** in the DevOps change request.\n\n **Note:** Ensure that the selected group has members and a group manager so the approver field is not empty.\n\n</td></tr><tr><td>\n\nChange type\n\n</td><td>\n\nChange request type to create.-   Normal \\(default\\)\n-   Standard\n-   Emergency\n\n\n</td></tr><tr><td>\n\nChange model\n\n</td><td>\n\nChange model for the change request. For more information, see [DevOps change models](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/devops-change-velocity/devops-change-multimodel.md).\n\n</td></tr><tr><td>\n\nTemplate\n\n **Note:** This field is shown only when **Change type** is Normal or Emergency.\n\n</td><td>\n\nList of templates to use to auto populate fields for Normal or Emergency change requests.\n\n Select a template or create a new one.\n\n</td></tr><tr><td>\n\nStandard change template\n\n **Note:** This field is shown only when **Change type** is Standard.\n\n</td><td>\n\nList of standard change templates to use for Standard change requests.**Note:** This field is required for Standard change type.\n\n</td></tr><tr><td>\n\nChange controlled branches\n\n</td><td>\n\n\\(Multibranch only\\) Comma-separated list of branches under change control. Wildcards are supported.\n\n</td></tr></tbody>\n</table>\n## Example\n\n\\[Omitted image \"dev-ops-pipeline.png\"\\] Alt text: DevOps pipeline\n\n\\[Omitted image \"dev-ops-pipeline-steps.png\"\\] Alt text: DevOps Pipeline Steps\n\n\\[Omitted image \"dev-ops-pipeline-stages.png\"\\] Alt text: DevOps pipeline stages\n\n**Parent Topic:**[Jenkins integration with DevOps Change Velocity](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/devops-change-velocity/jenkins-integration-dev-ops.md)\n\n"}}