Skip to content

Commit

Permalink
Create pipeline2.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
greydonbuckley committed Jun 7, 2023
1 parent c0ea7a1 commit 616e086
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/pipeline2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Pipeline with two change approvals

name: pipeline2

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run a one-line script
run: echo Running build step
test:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v3

- name: Copy results
run: echo "fake test step"

publish:
runs-on: ubuntu-latest
needs: test

steps:
- name: ServiceNow DevOps Register Artifact
uses: ServiceNow/[email protected]
with:
devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }}
devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }}
instance-url: ${{ secrets.SN_INSTANCE_URL }}
tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }}
context-github: ${{ toJSON(github) }}
job-name: 'publish'
artifacts: '[{"name": "com:demo4","version": "1.${{ github.run_number }}","semanticVersion": "1.${{ github.run_number }}.0","repositoryName": "${{ github.repository }}"}]'

deploy-to-uat:
name: deploy-to-uat
needs: publish
runs-on: ubuntu-latest
steps:
# - name: ServiceNow Change
# uses: ServiceNow/[email protected]
# with:
# devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }}
# devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }}
# instance-url: ${{ secrets.SN_INSTANCE_URL }}
# tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }}
# context-github: ${{ toJSON(github) }}
# job-name: 'Deploy'
# change-request: '{"setCloseCode":"true","attributes":{"short_description":"Deploy to UAT","description":"Automated Software Deployment.","assignment_group":"a715cd759f2002002920bde8132e7018","implementation_plan":"Software update is tested and results can be found in Test Summaries Tab; When the change is approved the implementation happens automated by the CICD pipeline within the change planned start and end time window.","backout_plan":"When software fails in production, the previous software release will be re-deployed.","test_plan":"Testing if the software was successfully deployed"}}'
# interval: '100'
# timeout: '3600'
# changeCreationTimeOut: '3600'
# abortOnChangeCreationFailure: true
# abortOnChangeStepTimeout: true

deploy-to-prod:
name: deploy-to-prod
needs: publish
runs-on: ubuntu-latest
steps:
# - name: ServiceNow Change
# uses: ServiceNow/[email protected]
# with:
# devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }}
# devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }}
# instance-url: ${{ secrets.SN_INSTANCE_URL }}
# tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }}
# context-github: ${{ toJSON(github) }}
# job-name: 'Deploy'
# change-request: '{"setCloseCode":"true","attributes":{"short_description":"Deploy to production","description":"Automated Software Deployment.","assignment_group":"a715cd759f2002002920bde8132e7018","implementation_plan":"Software update is tested and results can be found in Test Summaries Tab; When the change is approved the implementation happens automated by the CICD pipeline within the change planned start and end time window.","backout_plan":"When software fails in production, the previous software release will be re-deployed.","test_plan":"Testing if the software was successfully deployed"}}'
# interval: '100'
# timeout: '3600'
# changeCreationTimeOut: '3600'
# abortOnChangeCreationFailure: true
# abortOnChangeStepTimeout: true

0 comments on commit 616e086

Please sign in to comment.