Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAT Removal from pipeline generation yml #8370

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
311 changes: 163 additions & 148 deletions eng/common/pipelines/templates/jobs/prepare-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,166 +35,181 @@ jobs:
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
JimSuplizio marked this conversation as resolved.
Show resolved Hide resolved
# This covers our public repos.
- ${{ if not(endsWith(parameters.Repository, '-pr'))}}:
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization azure-sdk
--project public
--prefix ${{parameters.Prefix}}
--devopspath "\${{parameters.Prefix}}"
--path $(System.DefaultWorkingDirectory)/sdk
--endpoint Azure
--repository ${{parameters.Repository}}
--convention ci
--agentpool Hosted
--branch refs/heads/$(DefaultBranch)
--patvar PATVAR
--set-managed-variables
--debug
${{parameters.CIConventionOptions}}
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
weshaggard marked this conversation as resolved.
Show resolved Hide resolved
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization azure-sdk `
--project public `
--prefix ${{parameters.Prefix}} `
--devopspath "\${{parameters.Prefix}}" `
--path $(System.DefaultWorkingDirectory)/sdk `
--endpoint Azure `
--repository ${{parameters.Repository}} `
--convention ci `
--agentpool Hosted `
--branch refs/heads/$(DefaultBranch) `
--set-managed-variables `
--debug `
${{parameters.CIConventionOptions}}
displayName: Create CI Pipelines for Public Repository
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization azure-sdk
--project internal
--prefix ${{parameters.Prefix}}
--devopspath "\${{parameters.Prefix}}"
--path $(System.DefaultWorkingDirectory)/sdk
--endpoint Azure
--repository ${{parameters.Repository}}
--convention up
--agentpool Hosted
--branch refs/heads/$(DefaultBranch)
--patvar PATVAR
--set-managed-variables
--debug
${{parameters.UPConventionOptions}}
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization azure-sdk `
--project internal `
--prefix ${{parameters.Prefix}} `
--devopspath "\${{parameters.Prefix}}" `
--path $(System.DefaultWorkingDirectory)/sdk `
--endpoint Azure `
--repository ${{parameters.Repository}} `
--convention up `
--agentpool Hosted `
--branch refs/heads/$(DefaultBranch) `
--set-managed-variables `
--debug `
${{parameters.UPConventionOptions}}
displayName: Create UP Pipelines for Public Repository
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization azure-sdk
--project internal
--prefix ${{parameters.Prefix}}
--devopspath "\${{parameters.Prefix}}"
--path $(System.DefaultWorkingDirectory)/sdk
--endpoint Azure
--repository ${{parameters.Repository}}
--convention tests
--agentpool Hosted
--branch refs/heads/$(DefaultBranch)
--patvar PATVAR
--set-managed-variables
--debug
${{parameters.TestsConventionOptions}}
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization azure-sdk `
--project internal `
--prefix ${{parameters.Prefix}} `
--devopspath "\${{parameters.Prefix}}" `
--path $(System.DefaultWorkingDirectory)/sdk `
--endpoint Azure `
--repository ${{parameters.Repository}} `
--convention tests `
--agentpool Hosted `
--branch refs/heads/$(DefaultBranch) `
--set-managed-variables `
--debug `
${{parameters.TestsConventionOptions}}
displayName: Create Live Test Pipelines for Public Repository
condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}',''))
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization azure-sdk
--project internal
--prefix ${{parameters.Prefix}}
--devopspath "\${{parameters.Prefix}}"
--path $(System.DefaultWorkingDirectory)/sdk
--endpoint Azure
--repository ${{parameters.Repository}}
--convention testsweekly
--agentpool Hosted
--branch refs/heads/$(DefaultBranch)
--patvar PATVAR
--set-managed-variables
--debug
${{parameters.TestsConventionOptions}}
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization azure-sdk `
--project internal `
--prefix ${{parameters.Prefix}} `
--devopspath "\${{parameters.Prefix}}" `
--path $(System.DefaultWorkingDirectory)/sdk `
--endpoint Azure `
--repository ${{parameters.Repository}} `
--convention testsweekly `
--agentpool Hosted `
--branch refs/heads/$(DefaultBranch) `
--set-managed-variables `
--debug `
${{parameters.TestsConventionOptions}}
displayName: Create Weekly (Multi-Cloud) Live Test Pipelines for Public Repository
condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}',''))
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization azure-sdk
--project internal
--prefix ${{parameters.Prefix}}
--devopspath "\${{parameters.Prefix}}"
--path $(System.DefaultWorkingDirectory)/sdk
--endpoint Azure
--repository ${{parameters.Repository}}
--convention upweekly
--agentpool Hosted
--branch refs/heads/$(DefaultBranch)
--patvar PATVAR
--set-managed-variables
--debug
${{parameters.UPConventionOptions}}
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization azure-sdk `
--project internal `
--prefix ${{parameters.Prefix}} `
--devopspath "\${{parameters.Prefix}}" `
--path $(System.DefaultWorkingDirectory)/sdk `
--endpoint Azure `
--repository ${{parameters.Repository}} `
--convention upweekly `
--agentpool Hosted `
--branch refs/heads/$(DefaultBranch) `
--set-managed-variables `
--debug `
${{parameters.UPConventionOptions}}
displayName: Create Weekly (Multi-Cloud) Unified Test Pipelines for Public Repository
condition: and(succeeded(), eq(${{parameters.GenerateUnifiedWeekly}},true))
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)

# This covers our -pr repositories.
- ${{ if endsWith(parameters.Repository, '-pr')}}:
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization azure-sdk
--project internal
--prefix ${{parameters.Prefix}}-pr
--devopspath "\${{parameters.Prefix}}\pr"
--path $(System.DefaultWorkingDirectory)/sdk
--endpoint Azure
--repository ${{parameters.Repository}}
--convention ci
--agentpool Hosted
--branch refs/heads/$(DefaultBranch)
--patvar PATVAR
--set-managed-variables
--debug
--no-schedule
${{parameters.CIConventionOptions}}
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization azure-sdk `
--project internal `
--prefix ${{parameters.Prefix}}-pr `
--devopspath "\${{parameters.Prefix}}\pr" `
--path $(System.DefaultWorkingDirectory)/sdk `
--endpoint Azure `
--repository ${{parameters.Repository}} `
--convention ci `
--agentpool Hosted `
--branch refs/heads/$(DefaultBranch) `
--set-managed-variables `
--debug `
--no-schedule `
${{parameters.CIConventionOptions}}
displayName: Create CI Pipelines for Private Repository
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization azure-sdk
--project internal
--prefix ${{parameters.Prefix}}-pr
--devopspath "\${{parameters.Prefix}}\pr"
--path $(System.DefaultWorkingDirectory)/sdk
--endpoint Azure
--repository ${{parameters.Repository}}
--convention up
--agentpool Hosted
--branch refs/heads/$(DefaultBranch)
--patvar PATVAR
--set-managed-variables
--debug
--no-schedule
${{parameters.UPConventionOptions}}
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization azure-sdk `
--project internal `
--prefix ${{parameters.Prefix}}-pr `
--devopspath "\${{parameters.Prefix}}\pr" `
--path $(System.DefaultWorkingDirectory)/sdk `
--endpoint Azure `
--repository ${{parameters.Repository}} `
--convention up `
--agentpool Hosted `
--branch refs/heads/$(DefaultBranch) `
--set-managed-variables `
--debug `
--no-schedule `
${{parameters.UPConventionOptions}}
displayName: Create UP Pipelines for Private Repository
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization azure-sdk
--project internal
--prefix ${{parameters.Prefix}}-pr
--devopspath "\${{parameters.Prefix}}\pr"
--path $(System.DefaultWorkingDirectory)/sdk
--endpoint Azure
--repository ${{parameters.Repository}}
--convention tests
--agentpool Hosted
--branch refs/heads/$(DefaultBranch)
--patvar PATVAR
--set-managed-variables
--debug
--no-schedule
${{parameters.TestsConventionOptions}}
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization azure-sdk `
--project internal `
--prefix ${{parameters.Prefix}}-pr `
--devopspath "\${{parameters.Prefix}}\pr" `
--path $(System.DefaultWorkingDirectory)/sdk `
--endpoint Azure `
--repository ${{parameters.Repository}} `
--convention tests `
--agentpool Hosted `
--branch refs/heads/$(DefaultBranch) `
--set-managed-variables `
--debug `
--no-schedule `
${{parameters.TestsConventionOptions}}
displayName: Create Live Test Pipelines for Private Repository
condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}',''))
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)
37 changes: 19 additions & 18 deletions eng/pipelines/pipeline-generation-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,23 @@ jobs:
- script: |
git clone --filter=blob:none --branch $(Branch) https://$(azuresdk-github-pat)@github.com/azure/$(RepositoryName) $(Pipeline.Workspace)/$(RepositoryName)
displayName: 'Clone repository: $(RepositoryName)'
- script: >
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate
--organization $(DevOpsOrg)
--project $(DevOpsProject)
--prefix $(Prefix)
--devopspath "$(DevOpsPath)"
--path $(PathFilter)
--endpoint Azure
--repository Azure/$(RepositoryName)
--convention $(PipelineConvention)
--agentpool Hosted
--branch refs/heads/$(Branch)
--patvar PATVAR
--debug
$(AdditionalOptions)
- task: AzureCLI@2
inputs:
azureSubscription: 'opensource-api-connection'
scriptType: pscore
scriptLocation: inlineScript
inlineScript:
$(Pipeline.Workspace)/pipeline-generator/pipeline-generator generate `
--organization $(DevOpsOrg) `
--project $(DevOpsProject) `
--prefix $(Prefix) `
--devopspath "$(DevOpsPath)" `
--path $(PathFilter) `
--endpoint Azure `
--repository Azure/$(RepositoryName) `
--convention $(PipelineConvention) `
--agentpool Hosted `
--branch refs/heads/$(Branch) `
--debug `
$(AdditionalOptions)
displayName: 'Generate pipeline'
env:
PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat)

Loading