diff --git a/.github/workflows/testpipelinega.yml b/.github/workflows/testpipelinega.yml new file mode 100644 index 0000000..3037ccd --- /dev/null +++ b/.github/workflows/testpipelinega.yml @@ -0,0 +1,252 @@ +name: CustomActionGetWorkflow +on: + workflow_dispatch: + +jobs: +# registerartifact: +# name: Register Artifact +# runs-on: ubuntu-latest +# steps: +# - name: ServiceNow Register Artifact +# #uses: ServiceNow/servicenow-devops-register-artifact@v1.34.2 +# uses: ServiceNow/servicenow-devops-register-artifact@scratch_STRY55387369 +# with: +# devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN1 }} +# 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: 'Register Artifact' +# artifacts: '[{"name": "com:customactiondemotest","version": "1.${{ github.run_number }}","semanticVersion": "1.${{ github.run_number }}.0","repositoryName": "${{ github.repository }}"}]' +# registerpackage: +# name: Register Package +# #needs: registerartifact +# runs-on: ubuntu-latest +# steps: +# - name: ServiceNow Register Package +# uses: ServiceNow/servicenow-devops-register-package@scratch_STRY55387551 +# with: +# devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN1 }} +# #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: 'Register Package' +# artifacts: '[{"name": "com:customactiondemo","version": "1.${{ github.run_number }}","semanticVersion": "1.${{ github.run_number }}.0","repositoryName": "${{ github.repository }}"}]' +# package-name: 'registerpackage1.war' + CustomChange: + name: CustomChange + runs-on: ubuntu-latest + steps: + - name: Output Run ID + run: echo ${{ github.run_id }} + - name: Output Run Number + run: echo ${{ github.run_number }} + - name: Output Run Attempt + run: echo ${{ github.run_attempt }} + - name: Custom Change + uses: ServiceNow/servicenow-devops-change@dev + with: + devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }} + devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }} + devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} + instance-url: ${{ secrets.SN_INSTANCE_URL }} + tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} + context-github: ${{ toJSON(github) }} + job-name: 'CustomChange' + change-request: '{"setCloseCode":"true","attributes":{"short_description":"FIRST CR Automated Software Deployment","description":"Automated Software Deployment.","assignment_group":"a715cd759f2002002920bde8132e7018","implementation_plan":"Software update is tested and results can be found in Test Summaries Tab.","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: '10' + timeout: '1200' + abortOnChangeCreationFailure: true + abortOnChangeStepTimeout: true + getChangeStatus: + name: getChangeStatus + runs-on: ubuntu-latest + outputs: + output1: ${{steps.getChange.outputs.change-request-number }} + steps: + - name: Get Change Custom Action + uses: roy-ca/getChangeAction@main + id: getChange + with: + #devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} + 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) }} + #change-details: '{"pipeline_name":"saub90/web-api/CustomActionGetWorkflow","stage_name":"getChangeStatus","build_number":${{github.run_id}}}' + change-details: '{"pipeline_name":"saub90/web-api/CustomActionGetWorkflow","stage_name":"getChangeStatus","build_number":"5001220052"}' + run: echo ${{ steps.getChange.outputs.change-request-number }} >> "$GITHUB_OUTPUT" + - name: Output of GetChangeDetails + run: echo "The Status of Get Change Request Details => ${{ steps.getChange.outputs.change-request-number }}" + + UpdateChange: + name: UpdateChange + runs-on: ubuntu-latest + needs: getChangeStatus + steps: + - name: Output of getChangeStatus + run: echo "Change Request Number => ${{ needs.getChangeStatus.outputs.output1 }}" + - env: + OUTPUT1: ${{needs.getChangeStatus.outputs.output1 }} + run: echo $OUTPUT1 + - name: ServiceNow Update Change + uses: saub90/update-change@master + with: + tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} + devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} + devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }} + devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }} + instance-url: ${{ secrets.SN_INSTANCE_URL }} + context-github: ${{ toJSON(github) }} + #change-request-number: ${{ needs.getChangeStatus.outputs.output1 }} + change-request-number : "CHG0030016" + change-request-details: '{"close_code":"successful_issues","close_notes": "Test results unsuccessful","state":"3"}' + UpdateChangebasicauth: + name: UpdateChangeBasicAuth + runs-on: ubuntu-latest + needs: getChangeStatus + steps: + - name: Output of getChangeStatus + run: echo "Change Request Number => ${{ needs.getChangeStatus.outputs.output1 }}" + - env: + OUTPUT1: ${{needs.getChangeStatus.outputs.output1 }} + run: echo $OUTPUT1 + - name: ServiceNow Update Change + uses: saub90/update-change@master + with: + tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} + #devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} + devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }} + devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }} + instance-url: ${{ secrets.SN_INSTANCE_URL }} + context-github: ${{ toJSON(github) }} + #change-request-number: ${{ needs.getChangeStatus.outputs.output1 }} + change-request-number : "CHG0030016" + change-request-details: '{"close_code":"successful_issues","close_notes": "Test results unsuccessful","state":"3"}' + + UpdateChangebasicauthInvalid: + name: UpdateChangebasicauthInvalid + runs-on: ubuntu-latest + needs: getChangeStatus + steps: + - name: Output of getChangeStatus + run: echo "Change Request Number => ${{ needs.getChangeStatus.outputs.output1 }}" + - env: + OUTPUT1: ${{needs.getChangeStatus.outputs.output1 }} + run: echo $OUTPUT1 + - name: ServiceNow Update Change + uses: saub90/update-change@master + with: + tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} + devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} + instance-url: ${{ secrets.SN_INSTANCE_URL }} + context-github: ${{ toJSON(github) }} + #change-request-number: ${{ needs.getChangeStatus.outputs.output1 }} + change-request-number : "CHG0030014" + change-request-details: '{"close_code":"successful_issues","close_notes": "Test results unsuccessful","state":"3"}' + +# build: +# name: Build +# runs-on: ubuntu-latest +# steps: +# - name: Maven Build +# run: mvn clean install -DskipTests=true + +# - name: Sonar Cloud Analysis +# if: success() # always() failure() success() +# run: > +# mvn -B verify -DskipTests sonar:sonar +# -Dsonar.projectKey=$SONAR_PROJECT_KEY +# #-Dsonar.organization=$SONAR_ORG_KEY +# -Dsonar.host.url=$SONAR_URL +# -Dsonar.login=$SONAR_TOKEN +# env: +# GITHUB_TOKEN: ${{ secrets.GHP_TOKEN }} +# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +# SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} +# SONAR_URL: ${{ secrets.SONAR_URL }} +# #SONAR_ORG_KEY: ${{ secrets.SONAR_ORG_KEY }} + +# sonarActionGetWorkflow: +# name: Sonar Action +# runs-on: ubuntu-latest +# steps: +# - name: ServiceNow DevOps Sonar Scan Results +# uses: ServiceNow/servicenow-devops-sonar@scratch_STRY55387793 +# with: +# devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} +# #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: 'Build' +# sonar-host-url: ${{ secrets.SONAR_URL }} +# sonar-project-key: ${{ secrets.SONAR_PROJECT_KEY }} +# sonar-token: ${{ secrets.SONAR_TOKEN }} +# CustomChange: +# name: CustomChange +# runs-on: ubuntu-latest +# steps: +# - name: Output Run ID +# run: echo ${{ github.run_id }} +# - name: Output Run Number +# run: echo ${{ github.run_number }} +# - name: Output Run Attempt +# run: echo ${{ github.run_attempt }} +# - name: Custom Change +# uses: ServiceNow/servicenow-devops-change@v1.38.0 +# 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: 'CustomChange' +# change-request: '{"setCloseCode":"true","attributes":{"short_description":"FIRST CR Automated Software Deployment","description":"Automated Software Deployment.","assignment_group":"a715cd759f2002002920bde8132e7018","implementation_plan":"Software update is tested and results can be found in Test Summaries Tab.","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' +# getChangeStatus: +# name: getChangeStatus +# runs-on: ubuntu-latest +# outputs: +# output1: ${{steps.getChange.outputs.change-request-number }} +# steps: +# - name: Get Change Custom Action +# uses: roy-ca/getChangeAction@main +# id: getChange +# with: +# devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} +# instance-url: ${{ secrets.SN_INSTANCE_URL }} +# tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} +# context-github: ${{ toJSON(github) }} +# #change-details: '{"pipeline_name":"saub90/web-api/CustomActionGetWorkflow","stage_name":"getChangeStatus","build_number":${{github.run_id}}}' +# change-details: '{"pipeline_name":"saub90/web-api/CustomActionGetWorkflow","stage_name":"getChangeStatus","build_number":"5001220052"}' +# run: echo ${{ steps.getChange.outputs.change-request-number }} >> "$GITHUB_OUTPUT" +# - name: Output of GetChangeDetails +# run: echo "The Status of Get Change Request Details => ${{ steps.getChange.outputs.change-request-number }}" + +# UpdateChange: +# name: UpdateChange +# runs-on: ubuntu-latest +# needs: getChangeStatus +# steps: +# - name: Output of getChangeStatus +# run: echo "Change Request Number => ${{ needs.getChangeStatus.outputs.output1 }}" +# - env: +# OUTPUT1: ${{needs.getChangeStatus.outputs.output1 }} +# - name: ServiceNow Update Change +# uses: saub90/update-change@master +# with: +# tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} +# devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} +# devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }} +# devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }} +# instance-url: ${{ secrets.SN_INSTANCE_URL }} +# context-github: ${{ toJSON(github) }} +# change-request-number: ${{ needs.getChangeStatus.outputs.output1 }} +# change-request-details: '{"state":"3","close_code":"successful_issues","close_notes": "Test results unsuccessful"}' diff --git a/.github/workflows/undiscoveredpipeline.yml b/.github/workflows/undiscoveredpipeline.yml new file mode 100644 index 0000000..946a498 --- /dev/null +++ b/.github/workflows/undiscoveredpipeline.yml @@ -0,0 +1,36 @@ +name: Undiscovered +on: + workflow_dispatch: + +jobs: + registerartifact: + name: Register Artifact + runs-on: ubuntu-latest + steps: + - name: ServiceNow Register Artifact + uses: ServiceNow/servicenow-devops-register-artifact@scratch_STRY55387369 + with: + devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }} + devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }} + devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} + instance-url: ${{ secrets.SN_INSTANCE_URL }} + tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} + context-github: ${{ toJSON(github) }} + job-name: 'Register Artifact' + artifacts: '[{"name": "com:customactiondemo","version": "1.${{ github.run_number }}","semanticVersion": "1.${{ github.run_number }}.0","repositoryName": "${{ github.repository }}"}]' + registerpackage: + name: Register Package + runs-on: ubuntu-latest + steps: + - name: ServiceNow Register Package + uses: ServiceNow/servicenow-devops-register-package@scratch_STRY55387551 + with: + devops-integration-user-name: ${{ secrets.SN_DEVOPS_USER }} + devops-integration-user-password: ${{ secrets.SN_DEVOPS_PASSWORD }} + devops-integration-token: ${{ secrets.SN_DEVOPS_TOKEN }} + instance-url: ${{ secrets.SN_INSTANCE_URL }} + tool-id: ${{ secrets.SN_ORCHESTRATION_TOOL_ID }} + context-github: ${{ toJSON(github) }} + job-name: 'Register Package' + artifacts: '[{"name": "com:customactiondemo","version": "1.${{ github.run_number }}","semanticVersion": "1.${{ github.run_number }}.0","repositoryName": "${{ github.repository }}"}]' + package-name: 'registerpackage.war' diff --git a/k8s/helm/values.yaml b/k8s/helm/values.yaml index b0ca81b..8eba545 100644 --- a/k8s/helm/values.yaml +++ b/k8s/helm/values.yaml @@ -1,4 +1,4 @@ -replicaCount: 2 +replicaCount: 27 mongo: dbport : 27018 diff --git a/k8s/helm/values.yml b/k8s/helm/values.yml index 8342c5c..8fe5c61 100644 --- a/k8s/helm/values.yml +++ b/k8s/helm/values.yml @@ -1,4 +1,4 @@ -replicaCount: 2 +replicaCount: 6 mongo: dbport : 27017