GitHub 파이프라인 작업
파이프라인에서 GitHub 이러한 작업을 사용하여 데이터 모델과 상호 작용합니다 DevOps 구성 .
중요사항:
DevOps 구성 은 이제 더 이상 지원되지 않으며 새로운 활성화에 사용할 수 없습니다.
GitHub 스크립팅된 파이프라인과 선언적 파이프라인이 지원됩니다.
ServiceNow 특정 파이프라인 정의를 생성하기 위해 DevOps 구성 확인(servicenow-devops-config-validate) 및 DevOps 구성 익스포트(servicenow-devops-config-export) GitHub 작업이 제공됩니다.
DevOps 구성 확인(servicenow-devops-config-validate)
인스턴스에서 구성 데이터를 ServiceNow 업로드하고 유효성을 확인합니다.
- 입력 인수
인수 설명 인스턴스-URL ServiceNow 인스턴스 URL입니다. devops-integration-username DevOps 구성 통합 사용자 이름입니다. devops-integration-user-password DevOps 구성 통합 사용자 암호입니다. 애플리케이션 이름 DevOps 구성 애플리케이션 이름입니다. 대상 구성 파일이 업로드되는 데이터 모델 대상입니다. 데이터 모델 대상의 예는 다음과 같습니다.component수집배치 가능
배포 가능 이름 데이터 모델의 배포 가능 항목 이름입니다 DevOps 구성 . 컬렉션 이름 (선택 사항) 데이터 모델의 컬렉션 이름입니다. 대상이 수집인 경우 필요합니다. 이름-경로 (선택 사항) 구성 파일이 업로드되는 데이터 모델의 노드 이름 경로입니다. 구성 파일 경로 단일 파일을 업로드할 때의 파일 경로 또는 데이터 모델에 여러 파일을 업로드할 때 Ant 스타일 패턴을 기반으로 하는 파일 경로 패턴입니다. Ant.1.10.14 매뉴얼 설명서의 Ant-style 패턴에 Apache 대한 정보는 디렉토리 기반 작업을 참조하십시오. 데이터 형식 구성 파일의 데이터 형식입니다. 데이터 형식의 예는 다음과 같습니다.CSVINIJSON속성RAWXMLYAML
데이터 형식 속성 (선택 사항) 구성 데이터 구문 분석을 위한 확장된 데이터 형식 속성. 자동 커밋 업로드 성공 후 구성 데이터를 커밋하기 위한 부울(true 또는 false) 입력입니다. 기본값:
true자동 유효성 확인 커밋 성공 후 구성 데이터를 확인하기 위한 부울(true 또는 false) 입력입니다. 기본값:
true자동 게시 유효성 확인 성공 후 구성 데이터를 게시하기 위한 부울(true 또는 false) 입력입니다. 기본값:
true변경 세트 (선택 사항) 업로드 작업과 연결된 변경 세트를 엽니다. 제공되지 않은 경우 새 변경 세트가 작성됩니다. 스냅샷 확인 시간 초과 (선택 사항) 작업이 실패하기 전에 확인이 완료되는 최대 시간(분)입니다. 기본값:
60terminate-on-policy-validation-failures (선택 사항) 정책 확인 실패 후 워크플로우를 GitHub 종료하기 위한 부울(true 또는 false) 입력입니다. 기본값:
false- 출력
- changeset-number
업로드 작업과 연결된 변경 세트 번호입니다.
- 스냅샷 이름
배포 가능 항목의 최신 스냅샷 이름입니다.
- 확인 상태
스냅샷의 확인 상태입니다. 예:
통과,passed_with_exception,실패,execution_errornot_validated- validation-results
확인 결과는 스냅샷에 대한 JSON 형식입니다.
- 예 - 배포 가능 항목에 구성 파일 업로드
upload_and_validate_job: name: Upload and validate needs: <upstream job> runs-on: ubuntu-latest steps: - name: ServiceNow Devops Config Validate uses: ServiceNow/servicenow-devops-config-validate@v1.0.0-beta with: instance-url: ${{ secrets.SN_INSTANCE_URL }} devops-integration-username: ${{ secrets.SN_DEVOPS_CONFIG_USERNAME }} devops-integration-user-password: ${{ secrets.SN_DEVOPS_CONFIG_PASSWORD }} application-name: PaymentDemo target: deployable deployable-name: Production name-path: web-api-v1.0 auto-commit: true auto-validate: true auto-publish: true config-file-path: data/k8s/helm/*.yml data-format: yaml snapshot-validation-timeout: 60 terminate-on-policy-validation-failures: true- 예제 — 컬렉션에 구성 파일 업로드
upload_and_validate_job: name: Upload and validate needs: <upstream job> runs-on: ubuntu-latest steps: - name: ServiceNow Devops Config Validate uses: ServiceNow/servicenow-devops-config-validate@v1.0.0-beta with: instance-url: ${{ secrets.SN_INSTANCE_URL }} devops-integration-username: ${{ secrets.SN_DEVOPS_CONFIG_USERNAME }} devops-integration-user-password: ${{ secrets.SN_DEVOPS_CONFIG_PASSWORD }} application-name: PaymentDemo target: collection deployable-name: Production collection-name: release-1.0 name-path: web-api-v1.0 auto-commit: true auto-validate: true auto-publish: true config-file-path: data/k8s/helm/*.yml data-format: yaml snapshot-validation-timeout: 60 terminate-on-policy-validation-failures: true- 예제 — 구성 요소를 구성요소에 업로드
upload_and_validate_job: name: Upload and validate needs: <upstream job> runs-on: ubuntu-latest steps: - name: ServiceNow Devops Config Validate uses: ServiceNow/servicenow-devops-config-validate@v1.0.0-beta with: instance-url: ${{ secrets.SN_INSTANCE_URL }} devops-integration-username: ${{ secrets.SN_DEVOPS_CONFIG_USERNAME }} devops-integration-user-password: ${{ secrets.SN_DEVOPS_CONFIG_PASSWORD }} application-name: PaymentDemo target: component deployable-name: Production name-path: web-api-v1.0 auto-commit: true auto-validate: true auto-publish: true config-file-path: data/k8s/helm/*.yml data-format: yaml snapshot-validation-timeout: 60 terminate-on-policy-validation-failures: true- 예제 - 단일 커밋에서 여러 구성 파일 업로드
upload_and_validate_job: name: Upload and validate needs: <upstream job> runs-on: ubuntu-latest # Upload an XML file to a component steps: - name: ServiceNow Devops Config Validate id: upload_and_validate_xml uses: ServiceNow/servicenow-devops-config-validate@v1.0.0-beta with: instance-url: ${{ secrets.SN_INSTANCE_URL }} devops-integration-username: ${{ secrets.SN_DEVOPS_CONFIG_USERNAME }} devops-integration-user-password: ${{ secrets.SN_DEVOPS_CONFIG_PASSWORD }} application-name: PaymentDemo target: component deployable-name: Production name-path: web-api-v1.0 auto-commit: false auto-validate: true auto-publish: true config-file-path: data/infra/v1/*.xml data-format: xml snapshot-validation-timeout: 60 terminate-on-policy-validation-failures: true # Upload a JSON file to the vars folder of a deployable steps: - name: ServiceNow Devops Config Validate id: upload_and_validate_json uses: ServiceNow/servicenow-devops-config-validate@v1.0.0-beta with: instance-url: ${{ secrets.SN_INSTANCE_URL }} devops-integration-username: ${{ secrets.SN_DEVOPS_CONFIG_USERNAME }} devops-integration-user-password: ${{ secrets.SN_DEVOPS_CONFIG_PASSWORD }} application-name: PaymentDemo target: component deployable-name: Production name-path: web-api-v1.0 auto-commit: true auto-validate: true auto-publish: true config-file-path: data/infra/prod/*.json data-format: json snapshot-validation-timeout: 60 terminate-on-policy-validation-failures: true changeset : ${{ steps.upload_and_validate_xml.outputs.changeset-number }}
DevOps 구성 익스포트(servicenow-devops-config-export)
를 사용하여 ServiceNow DevOps 구성구성 데이터를 익스포트합니다.
- 입력 인수
인수 설명 인스턴스-URL ServiceNow 인스턴스 URL입니다. devops-integration-username DevOps 구성 통합 사용자 이름입니다. devops-integration-user-password DevOps 구성 통합 사용자 암호입니다. 애플리케이션 이름 DevOps 구성 애플리케이션 이름입니다. 배포 가능 이름 데이터 모델의 배포 가능 항목 이름입니다 DevOps 구성 . 익스포터 이름 데이터 모델에서 구성 데이터를 DevOps 구성 익스포트하는 익스포터 이름입니다. 스냅샷 이름 (선택 사항) 데이터를 익스포트할 스냅샷입니다. 스냅샷을 지정하지 않으면 배포 가능 항목의 최신 스냅샷이 사용됩니다. 내보내기-데이터-형식 (선택 사항) 스냅샷 데이터를 익스포트하는 형식입니다. 데이터 형식의 예는 다음과 같습니다.CSVINIJSON속성RAWXMLYAML
익스포터-인수 (선택 사항) 익스포터와 함께 사용할 인수입니다. 값은 문자열로 표시된 JSON 객체여야 합니다. - 출력
- Exporter-Content
익스포터가 익스포트하는 구성 데이터입니다.
- 예 — 특정 스냅샷 내보내기
export: name: Export config needs: <upstream job> runs-on: ubuntu-latest steps: - name: ServiceNow DevOps Config Export uses: ServiceNow/servicenow-devops-config-export@v1.0.0-beta with: instance-url: ${{ secrets.SN_INSTANCE_URL }} devops-integration-username: ${{ secrets.SN_DEVOPS_CONFIG_USERNAME }} devops-integration-password: ${{ secrets.SN_DEVOPS_CONFIG_PASSWORD }} application-name: PaymentDemo deployable-name: Production exporter-name: returnDataforNodeName-now snapshot-name: Production-v1.dpl exporter-arguments: '{ "nodeName": "node1" }'- 예 - 추가 파라미터를 사용하여 최근에 배포된 스냅샷 내보내기
export: name: Export config needs: <upstream job> runs-on: ubuntu-latest steps: - name: ServiceNow DevOps Config Export uses: ServiceNow/servicenow-devops-config-export@v1.0.0-beta with: instance-url: ${{ secrets.SN_INSTANCE_URL }} devops-integration-username: ${{ secrets.SN_DEVOPS_CONFIG_USERNAME }} devops-integration-password: ${{ secrets.SN_DEVOPS_CONFIG_PASSWORD }} application-name: PaymentDemo deployable-name: Production exporter-name: returnDataforNodeName-now exporter-arguments: '{ "nodeName": "node1" }' exporter-data-format: XML