How to Automated Deployments using Build and Release Pipelines

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 08:00 AM
Our team is looking at how to automate deployment from dev to test instances using Azure Pipelines, Git Pipelines, etc. Are there any API endpoints available to initiate a "Publish" and/or "Install" command on a ServiceNow instance? Basically, what we’re trying to create is a build pipeline that gets triggered by a pull request and then invoke the publish or install commands via a REST API call. This is basically what we do on the full stack development side of things (change is made, pull request approved, test is built). QA and Prod require a release approval.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 05:25 AM
Why yes there is... it's called the "Continuous Integration/Continuous Delivery (CI/CD) API".
You can set up your own pipeline or utilize App Engine Studio. In AES, there is the concept of a "Deployment Request". When the request is approved, AES uses the CI/CD API to move the app from Dev to Test to Prod while stopping in Test to do some automated testing before going to Prod.
--------------------------------------------------
Workflow Cowboy
LinkedIn: https://www.linkedin.com/in/dalestubblefield/
YouTube: https://www.youtube.com/@starlordnow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 05:27 AM
CI/CI API also leverages Application Repository. It's good to be familiar with how the Application Repository works as well.
App Repo -> https://docs.servicenow.com/bundle/sandiego-application-development/page/build/applications/concept/...
Here's a nice deployment diagram as well -> https://developer.servicenow.com/dev.do#!/guides/sandiego/now-platform/pro-dev-guide/pd-deploy
--------------------------------------------------
Workflow Cowboy
LinkedIn: https://www.linkedin.com/in/dalestubblefield/
YouTube: https://www.youtube.com/@starlordnow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 08:21 AM
This is great Dale! After some initial investigation, it looks like to say publish an application I would need to do something like the following:
In ServiceNow:
- Install the Integration Hub Stater Pack
- Create a CI/CD credential to my repo.
- Create a Scripted REST API that calls the "Publish Application With Scope" subflow provided
In Jenkins, ADO, Github, etc:
- Create the build pipeline
- Trigger it manually
- Call the Scripted REST API endpoint with required inputs (i.e.scope, credential_alias, instance_url)
I'm going to try this and post my results. This won't work in a PDI since you can't publish to the store, so my goal is to at least hit the endpoint and get the error from the subflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 09:37 AM
You are on the right path. Correct that it will not work in a PDI as PDI can not publish to Application Repository. App Repo is only available on ServiceNow customer instances.
--------------------------------------------------
Workflow Cowboy
LinkedIn: https://www.linkedin.com/in/dalestubblefield/
YouTube: https://www.youtube.com/@starlordnow