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

Abstract auth to the dev feeds. additionally, add pip auth #13522

Merged
merged 5 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ parameters:
CoverageArg: '--disablecov'
RunForPR: false
AdditionalTestMatrix: []
DevFeedName: 'public/azure-sdk-for-python'

jobs:
- job: 'Build'
Expand Down
21 changes: 4 additions & 17 deletions eng/pipelines/templates/stages/archetype-python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ parameters:
ArtifactName: 'not-specified'
DependsOn: Build
DocArtifact: 'documentation'
DevFeedName: public/azure-sdk-for-python
DevFeedName: 'public/azure-sdk-for-python'
TargetDocRepoOwner: ''
TargetDocRepoName: ''

Expand Down Expand Up @@ -236,22 +236,9 @@ stages:
pip install twine
displayName: Install Twine

- pwsh: |
# For safety default to publishing to the private feed.
# Publish to https://dev.azure.com/azure-sdk/internal/_packaging?_a=feed&feed=azure-sdk-for-python-pr
$devopsFeedName = 'internal/azure-sdk-for-python-pr'
if ('$(Build.Repository.Name)' -eq 'Azure/azure-sdk-for-python') {
# Publish to https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-python
$devopsFeedName = '${{ parameters.DevFeedName }}'
}
echo "##vso[task.setvariable variable=DevFeedName]$devopsFeedName"
echo "Using DevopsFeed = $devopsFeedName"
displayName: Setup DevOpsFeedName

- task: TwineAuthenticate@0
displayName: 'Authenticate to feed'
inputs:
artifactFeeds: $(DevFeedName)
- template: ../steps/auth-dev-feed.yml
parameters:
DevFeedName: ${{ parameters.DevFeedName }}

- ${{ each artifact in parameters.Artifacts }}:
- pwsh: |
Expand Down
7 changes: 6 additions & 1 deletion eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ parameters:
- name: AdditionalTestMatrix
type: object
default: []
- name: DevFeedName
type: string
default: public/azure-sdk-for-python

stages:
- stage: Build
Expand All @@ -38,6 +41,7 @@ stages:
InjectedPackages: ${{parameters.InjectedPackages}}
SkipPythonVersion: ${{parameters.SkipPythonVersion}}
AdditionalTestMatrix: ${{parameters.AdditionalTestMatrix}}
DevFeedName: ${{parameters.DevFeedName}}

# The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch.
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}:
Expand All @@ -49,4 +53,5 @@ stages:
ArtifactName: packages
DocArtifact: documentation
TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}}
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
TargetDocRepoName: ${{parameters.TargetDocRepoName}}
DevFeedName: ${{parameters.DevFeedName}}
26 changes: 26 additions & 0 deletions eng/pipelines/templates/steps/auth-dev-feed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
parameters:
DevFeedName: 'public/azure-sdk-for-python'

steps:
- pwsh: |
# For safety default to publishing to the private feed.
# Publish to https://dev.azure.com/azure-sdk/internal/_packaging?_a=feed&feed=azure-sdk-for-python-pr
$devopsFeedName = 'internal/azure-sdk-for-python-pr'
if ('$(Build.Repository.Name)' -eq 'Azure/azure-sdk-for-python') {
# Publish to https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-python
$devopsFeedName = '${{ parameters.DevFeedName }}'
}
echo "##vso[task.setvariable variable=DevFeedName]$devopsFeedName"
echo "Using DevopsFeed = $devopsFeedName"
displayName: Setup DevOpsFeedName

- task: TwineAuthenticate@0
displayName: 'Twine Authenticate to feed'
inputs:
artifactFeeds: $(DevFeedName)

- task: PipAuthenticate@1
displayName: 'Pip Authenticate to feed'
inputs:
artifactFeeds: $(DevFeedName)
onlyAddExtraIndex: true
6 changes: 6 additions & 0 deletions eng/pipelines/templates/steps/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parameters:
RunCoverage: ne(variables['CoverageArg'], '--disablecov')
ToxEnvParallel: ''
InjectedPackages: ''
DevFeedName: 'public/azure-sdk-for-python'

steps:
- pwsh: |
Expand All @@ -32,6 +33,11 @@ steps:
pip freeze
displayName: 'Prep Environment'

- ${{if eq(variables['System.TeamProject'], 'internal') }}:
weshaggard marked this conversation as resolved.
Show resolved Hide resolved
- template: ../steps/auth-dev-feed.yml
parameters:
DevFeedName: ${{ parameters.DevFeedName }}

- ${{ parameters.BeforeTestSteps }}

- task: PythonScript@0
Expand Down