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

Switch all Tools to net feed #1853

Merged
merged 9 commits into from
Jul 30, 2021
93 changes: 0 additions & 93 deletions .azure-pipelines/dotnet.yml

This file was deleted.

111 changes: 67 additions & 44 deletions eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,74 @@
resources:
repositories:
- repository: azure-sdk-build-tools
type: git
name: internal/azure-sdk-build-tools
ref: refs/tags/azure-sdk-build-tools_20210603.1

parameters:
DotNetCoreVersion: ''
SkipDotNetInstall: false

pool:
name: azsdk-pool-mms-ubuntu-2004-general
vmImage: MMSUbuntu20.04

variables:
- template: ../variables/globals.yml

stages:
- stage: Build
variables:
- template: ../variables/globals.yml
jobs:
- job: BuildPackage
pool:
name: azsdk-pool-mms-ubuntu-2004-general
vmImage: MMSUbuntu20.04
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk ${{ coalesce( parameters.DotNetCoreVersion, variables.DotNetCoreVersion) }}'
inputs:
version: '${{ coalesce( parameters.DotNetCoreVersion, variables.DotNetCoreVersion) }}'
- script: 'dotnet pack -o $(Build.ArtifactStagingDirectory) -warnaserror'
displayName: 'Build and Package'
workingDirectory: $(Build.SourcesDirectory)/tools/${{parameters.ToolDirectory}}
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
- publish: $(Build.ArtifactStagingDirectory)
displayName: Publish package to run artifacts
artifact: packages
condition: succeededOrFailed()
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}:
- stage: Release
dependsOn: Build
- stage: BuildTestAndPackage

jobs:
- deployment: PublishPackage
environment: tools
pool:
name: azsdk-pool-mms-ubuntu-2004-general
vmImage: MMSUbuntu20.04
variables:
- template: ../variables/globals.yml
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/packages/**/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '29ec6040-b234-4e31-b139-33dc4287b756/12354d14-c9a7-4f21-97dc-d3b97f89d71d'
- job: BuildAndPackage

steps:
- task: UseDotNet@2
condition: eq(${{ parameters.SkipDotNetInstall }}, false)
displayName: 'Use .NET Core sdk ${{ coalesce( parameters.DotNetCoreVersion, variables.DotNetCoreVersion) }}'
inputs:
version: '${{ coalesce( parameters.DotNetCoreVersion, variables.DotNetCoreVersion) }}'

- script: 'dotnet pack -o $(Build.ArtifactStagingDirectory) -warnaserror'
displayName: 'Build and Package'
workingDirectory: $(Build.SourcesDirectory)/${{parameters.ToolDirectory}}
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0

- publish: $(Build.ArtifactStagingDirectory)
displayName: Publish package to run artifacts
artifact: packages
condition: succeededOrFailed()

- job: Test

steps:
- task: UseDotNet@2
condition: eq(${{ parameters.SkipDotNetInstall }}, false)
displayName: 'Use .NET Core sdk ${{ coalesce( parameters.DotNetCoreVersion, variables.DotNetCoreVersion) }}'
inputs:
version: '${{ coalesce( parameters.DotNetCoreVersion, variables.DotNetCoreVersion) }}'

- script: 'dotnet test -o $(Build.ArtifactStagingDirectory) -warnaserror --logger trx'
displayName: 'Test'
workingDirectory: $(Build.SourcesDirectory)/${{parameters.ToolDirectory}}
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/*.trx'
testRunTitle: 'Windows DotNet $(DotNetCoreVersion)'
testResultsFormat: 'VSTest'
mergeTestResults: true

- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}:
- template: pipelines/stages/net-release-to-feed.yml@azure-sdk-build-tools
parameters:
# Publish to https://dev.azure.com/azure-sdk/public/_packaging?_a=feed&feed=azure-sdk-for-net
DevOpsFeedId: '29ec6040-b234-4e31-b139-33dc4287b756/fa8c16a3-dbe0-4de2-a297-03065ec1ba3f'
27 changes: 27 additions & 0 deletions src/dotnet/Azure.ClientSdk.Analyzers/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a follow-up but we should probably move things from src/dotnet to tools directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pipeline doesn't seem to be triggering.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rEQUIRE pr cOMMENTS

Its probably because this option is checked.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chidozieononiwu You didn't create a public pipeline for this ci.yml only an internal one. I renamed the old azure-sdk-tools - dotnet pipeline in public to tools - Azure.ClientSdk.Analyzers - ci to fix this. You might also need to setup a public pipeline for the snippet generator.

trigger:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
paths:
include:
- tools/dotnet/Azure.ClientSdk.Analyzers

pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
paths:
include:
- src/dotnet/Azure.ClientSdk.Analyzers

stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: src/dotnet/Azure.ClientSdk.Analyzers
2 changes: 1 addition & 1 deletion tools/CreateRuleFabricBot/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ pr:
stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: CreateRuleFabricBot
ToolDirectory: tools/CreateRuleFabricBot
2 changes: 1 addition & 1 deletion tools/http-fault-injector/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ pr:
stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: http-fault-injector
ToolDirectory: tools/http-fault-injector
2 changes: 1 addition & 1 deletion tools/notification-configuration/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ pr:
stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: notification-configuration
ToolDirectory: tools/notification-configuration
2 changes: 1 addition & 1 deletion tools/pipeline-generator/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ pr:
stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: pipeline-generator
ToolDirectory: tools/pipeline-generator
2 changes: 1 addition & 1 deletion tools/test-proxy/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ pr:
stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: test-proxy
ToolDirectory: tools/test-proxy
DotNetCoreVersion: "5.0.100"
2 changes: 1 addition & 1 deletion tools/version-guard/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ pr:
stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: version-guard
ToolDirectory: tools/version-guard