Setting up the DevOps connection with Jenkins
To use Jenkins with ServiceNow DevOps and get
the benefits of this orchestration pipeline,... ... you must establish a connection between the two. This video shows how to do that. You can skip to any of these topics from the YouTube description for this video. Before setting up the Jenkins tool in DevOps,
there are several things we need to do. First, we need access to Jenkins. We already have that, so we’ll check it off. Next, we must install the DevOps and DevOps Integrations apps on the ServiceNow instance we’ll use to communicate with Jenkins. We install the Jenkins plugin for ServiceNow DevOps. This must be done by a Jenkins administrator. The plug-in is available in the ServiceNow Store. Now we’re ready to configure the DevOps connection and credential alias,... ... which must be done before setting up your tool records in DevOps. This task requires the admin or connection_admin role. We start with a new connection and give it a name. For the Credential field, we use the lookup icon and click New to create a new credential. And the type we want is Basic Auth Credentials. We give our credential record a name…. …And provide the credentials required to access the tools in our DevOps environment. The User name could be any user in the instance who has the connection_admin and credential_admin roles. In our case, we previously created a user called devops.system with those roles, specifically for this purpose. Now we submit our basic auth credentials and complete the rest of the Connection form. The Connection URL must be in this format: The https protocol followed by the instance
name and ServiceNow domain, and this path. Let’s just copy the first part from the browser URL field,... …Paste it in the Connection URL field…. …And then enter the path manually. That’s it! And the final prerequisite is to configure the coding tool. Now that all the prerequisites are done, we’re
ready to configure the orchestration tool... …which, in our case, is Jenkins. For that, we’ll need to go back and forth between Jenkins and our ServiceNow instance... ... so we’ve got them both open in browser tabs. The sn_devops.admin role is required to perform this task. This is the Create DevOps Tool form, where we
create a DevOps orchestration tool connection,... ... which is required to discover Jenkins pipelines. In the Tool Name field, we enter a name for the tool. We’ll just call ours Demo for modeling Jenkins pipeline.
In the Tool Integration field, we select Jenkins. If Jenkins is not available as an option, it means the DevOps
Integrations application isn’t installed. Now we need the Tool URL. Let’s copy it from Jenkins… …and paste it here. These two next fields are where we enter the credentials that
DevOps uses to connect to Jenkins…. …Our username… …and password. MID Server is an optional field. Select it if you have on-premise tools attached to a MID Server. When we select Submit, DevOps connects with Jenkins. This notification indicates that we connected successfully. If we hadn’t, an error message would have been displayed... ... and we would need to resolve it because without a connection, we can’t discover Jenkins pipelines. Our Connection state is Connected. So now we click Discover to initiate a discovery request. DevOps discover is an asynchronous process that works through Jenkins,... ... collecting information about pipelines. You can check the details of the discovery process by clicking its record number in the notification at the top of the form. In our case, it discovered 1 orchestration task and 3 pipelines. Now that we’ve connected to Jenkins, we’re ready to model the pipelines we discovered in DevOps. For more information, see our product documentation, knowledge base, or podcast. Or ask a question in the ServiceNow Community.
https://www.youtube.com/watch?v=JlDV9JAFYNg