Azure Pipelines용 BulkRun Powershell 스크립트
8104 단어 devopsazurepipelinespowershell
이 작업을 수행하기 위해 저는 Azure Devops rest API를 사용하여 프로그래밍 방식으로 파이프라인 세트를 실행하는 간단한 powershell 스크립트를 생성했으며 여기에는 Personal Access Token이 필요합니다.
예시
# Step 1: Create the pipeline on Azure Devops with following yaml code. Below an example with parameters.
parameters:
- name: name
displayName: "Name"
type: string
- name: surname
displayName: "Surname"
type: string
pool:
vmImage: ubuntu-latest
steps:
- script: echo Hello ${{ parameters.name }} ${{ parameters.surname }}
displayName: 'Run a one-line script'
# Step 2: Create a pipeline definition file (pipetorun.csv) with the information to run an ado pipeline for each row.
# The definitionid is the definitionid of Azure Devops pipeline
# Branch is the pipeline's branch.
# Parameters are defined as a dictionary (key=value separate by semicolon, key is equal the pipeline parameter name)
definitionid,name,branch,parameters
12,hello,main,name=Alan;surname=Turing
12,hello,main,name=Clude;surname=Shannon
12,hello,main,name=Tim;surname=Berners-Lee
12,hello,main,name=Edsger;surname=Dijkstra
12,hello,main,name=Leslie;surname=Lamport
# Step 3: Run five pipeline by using the script and the defintion file. (How to create a PAT )
.\BulkRun.ps1 -PAT personal-access-token -File .\pipetorun.csv
# Result
hello inProgress on main -> https://dev.azure.com/dimotta/demo/_build/results?buildId=119
hello inProgress on main -> https://dev.azure.com/dimotta/demo/_build/results?buildId=120
hello inProgress on main -> https://dev.azure.com/dimotta/demo/_build/results?buildId=121
hello inProgress on main -> https://dev.azure.com/dimotta/demo/_build/results?buildId=122
hello inProgress on main -> https://dev.azure.com/dimotta/demo/_build/results?buildId=123
BulkRun 스크립트 코드를 사용할 수 있습니다here.
Reference
이 문제에 관하여(Azure Pipelines용 BulkRun Powershell 스크립트), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/antdimot/bulkrun-powershell-script-for-azure-pipelines-fm6텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)