ServiceNow / sncicd-batch-install

MIT License
8 stars 5 forks source link

ServiceNow CI/CD GitHub Action for Batch Install

Installs two or more packages in a single specified batch.

https://developer.servicenow.com/dev.do#!/reference/api/quebec/rest/cicd-api#cicd-POST-app-batch-install

Usage

Step 1: Prepare values for setting up your variables for Actions

Step 2: Configure Secrets in your GitHub repository

On GitHub, go in your repository settings, click on the secret Secrets and create a new secret.

Create secrets called

Step 3: Example Workflow Template

https://github.com/ServiceNow/sncicd_githubworkflow

Step 4: Configure the GitHub Action if need to adapt for your needs or workflows

# This step is required if source is equal to file
- name: Checkout
  uses: actions/checkout@v2
- name: Batch Install 
  id: sncicd-batch-install # id of the step
  uses: ServiceNow/sncicd-batch-install@1.0 
  with:
    # required(file/workflow)
    source: file
    # optional(otherwise use default name now_batch_manifest.json)
    filename: manifest.json
    # required if source is equal to workflow
    manifest: <JSON string here> 
  env:
    nowUsername: ${{ secrets.NOW_USERNAME }}
    nowPassword: ${{ secrets.NOW_PASSWORD }}
    nowInstallInstance: ${{ secrets.NOW_CLIENT_INSTANCE }}

Inputs:

Outputs:

JSON payload example:

{
    "name": "Batch name here",
    "notes": "Your notes here",
    "packages": [
        {
            "id": "{{sys_id}}",
            "type": "application",
            "load_demo_data": false,
            "requested_version": "{{version}}",
            "requested_customization_version": "{{version}}",
            "notes": "{{notes}}"
        }
    ]
}

Environment variable should be set up in the Step 1

Contributing

Tests

Tests should be ran via npm commands:

Unit tests

npm run test

Integration test

npm run integration

Build

npm run build

Formatting and Linting

npm run format
npm run lint

Notices

Support Model

ServiceNow built this integration with the intent to help customers get started faster in adopting CI/CD APIs for DevOps workflows, but will not be providing formal support. This integration is therefore considered "use at your own risk", and will rely on the open-source community to help drive fixes and feature enhancements via Issues. Occasionally, ServiceNow may choose to contribute to the open-source project to help address the highest priority Issues, and will do our best to keep the integrations updated with the latest API changes shipped with family releases. This is a good opportunity for our customers and community developers to step up and help drive iteration and improvement on these open-source integrations for everyone's benefit.

Governance Model

Initially, ServiceNow product management and engineering representatives will own governance of these integrations to ensure consistency with roadmap direction. In the longer term, we hope that contributors from customers and our community developers will help to guide prioritization and maintenance of these integrations. At that point, this governance model can be updated to reflect a broader pool of contributors and maintainers.