This is an example implementation of the CICD-Server for ServiceNow. It allows to send changes, captured in Update-Sets in ServiceNow, to a CICD pipeline including running ATF test cases in ServiceNow.\ Example build results:
More information about the core module can be found here https://github.com/bmoers/sn-cicd#cicd-server-for-service-now-v3
A video recording from the K18 session, where CICD-Server version 1 was presented, can be found here.
In this example you're going to:
deploy the scoped app
As the code is stored in a GIT repo, one can also hook in other standard CICD build tools to trigger further actions like performance or UAT.\ The process requires two environment. One acts as 'source' (the development environment) - one acts as 'master' and 'target' environment. This is just to simplify the demo setup.
A recording of this how-to can be found on YouTube:\
cicd_integration_user
group.atf_test_*
and impersonator
groups.admin
! groupNavigate to 'CICD Integration > Properties' and enable at least following:
git clone git@github.com:bmoers/sn-cicd-example-v3.git
cd sn-cicd-example-v3
## Configure the CICD-Server
- **Rename `example.env` to `.env`**\
This file contains all credentials and necessary information to run the CICD-Server. Make sure you **never** commit it to a GIT repo.
> Assuming two ServiceNow environments
> - dev12345.service-now.com The Dev instance (<dev12345-dev-instance;>)
> - dev23456.service-now.com The Prod instance (<dev23456-prod-instance;>)
>
Add following information to the .env file:
```bash
# ----- !! REQUIRED !! -----
# github credentials
CICD_PR_USER_NAME=<github-user-id>
# the github token (or password)
CICD_PR_USER_PASSWORD=<******************************>
# ServiceNow host name - this host acts as proxy to route the web hooks to the CICD-Server (via MID)
CICD_WEBHOOK_PROXY_SERVER=<dev12345-dev-instance>
# Secret (see cicd-integration properties in ServiceNow)
CICD_WEBHOOK_SECRET=5VCSj9SPRH3EbNHrBSTf
#GitHub project information
CICD_GIT_HOST=git@github.com:<github-user-id>/
CICD_GIT_URL=https://github.com/<github-user-id>/
# default git master source - let this point to production environment
CICD_GIT_MASTER_SOURCE=<dev23456-prod-instance>.service-now.com
# user to run the ATF test cases
CICD_ATF_TEST_USER_NAME=admin
CICD_ATF_TEST_USER_PASSWORD=<***********>
# user to load update-set form 'source' and 'master'
CICD_CI_USER_NAME=admin
CICD_CI_USER_PASSWORD=<***********>
# user to deploy update-set to 'target'
CICD_CD_USER_NAME=admin
CICD_CD_USER_PASSWORD=<***********>
# deployment target definition
CICD_CD_DEPLOYMENT_TARGET=<dev23456-prod-instance>.service-now.com
# ----- ** OPTIONAL ** -----
# toggle slack integration
CICD_SLACK_ENABLED=true
# webhook url
CICD_SLACK_WEBHOOK=https://hooks.slack.com/services/<********>/<********>/<*****************************>
In sn-cicd-example-v3 run:
npm install
and:
npm start
The web-UI is available under http://localhost:8080/ (depending of your server-options settings).\ If HTTPS is enabled you might see a "page not secure" warning. This is due to self signed certificates in this example project.\ It requires a run at least one build to display any information.
If you'd like to run the CICD-Server as a Docker container please have a look at the Dockerfile. Use Docker Compose to also start a MID server.
TL;DR:
Or create the app manually:
If you want to contribute to this project, please fork the core project https://github.com/bmoers/sn-cicd
The project is designed to use extensions. The core project (bmoers/sn-cicd) contains all 'shared' features. Customization which are dedicated to your ServiceNow environment or CICD pipeline shall be added to the 'extending' project (like this one.)
https://github.com/bmoers/sn-cicd-example-v3 \
--> extends
https://github.com/bmoers/sn-cicd \
--> uses
https://github.com/bmoers/sn-project \
https://github.com/bmoers/sn-rest-client