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.

6 changes: 0 additions & 6 deletions dotnet.proj

This file was deleted.

116 changes: 73 additions & 43 deletions eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,81 @@
parameters:
DotNetCoreVersion: ''
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:
- name: ToolDirectory
type: string
default: ''
- name: DotNetCoreVersion
type: string
default: ''
- name: SkipDotNetInstall
type: boolean
default: false

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

stages:
- stage: Build
variables:
- template: ../variables/globals.yml
jobs:
- job: BuildPackage
- stage: BuildTestAndPackage

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

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'
28 changes: 28 additions & 0 deletions src/dotnet/Azure.ClientSdk.Analyzers/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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:
- src/dotnet/Azure.ClientSdk.Analyzers

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

extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: src/dotnet/Azure.ClientSdk.Analyzers
SkipDotNetInstall: true
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Tests
private string _repo = "<PleaseSpecify>";
private FabricBotClient _requestSender;

[OneTimeSetUp]
//[OneTimeSetUp]
public void OneTimeSetup()
{
string token = Environment.GetEnvironmentVariable("officebot_token");
Expand All @@ -25,6 +25,7 @@ public void OneTimeSetup()
}

[Test]
[Ignore("Can't run test without officebot_token")]
public void CreateUpdateDeleteRule()
{
IssueRoutingCapability irc = new IssueRoutingCapability(_org, _repo, "");
Expand Down
9 changes: 5 additions & 4 deletions tools/CreateRuleFabricBot/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ pr:
include:
- tools/CreateRuleFabricBot

stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: CreateRuleFabricBot
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: tools/CreateRuleFabricBot
SkipDotNetInstall: true
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<Version>0.2.0</Version>
<VersionPrefix>0.2.0</VersionPrefix>

<TargetFramework>netcoreapp3.1</TargetFramework>

Expand Down
8 changes: 4 additions & 4 deletions tools/http-fault-injector/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pr:
include:
- tools/http-fault-injector

stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: http-fault-injector
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: tools/http-fault-injector
8 changes: 4 additions & 4 deletions tools/notification-configuration/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pr:
include:
- tools/notification-configuration

stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: notification-configuration
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: tools/notification-configuration
8 changes: 4 additions & 4 deletions tools/pipeline-generator/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pr:
include:
- tools/pipeline-generator

stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: pipeline-generator
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: tools/pipeline-generator
10 changes: 5 additions & 5 deletions tools/test-proxy/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pr:
include:
- tools/test-proxy

stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: test-proxy
DotNetCoreVersion: "5.0.100"
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: tools/test-proxy
DotNetCoreVersion: "5.0.100"
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Version>0.1.0</Version>
<VersionPrefix>0.1.0</VersionPrefix>

<PackAsTool>true</PackAsTool>
<ToolCommandName>version-guard</ToolCommandName>
Expand Down
9 changes: 5 additions & 4 deletions tools/version-guard/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ pr:
include:
- tools/version-guard

stages:
- template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: version-guard
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: tools/version-guard
SkipDotNetInstall: true