Skip to content

Instantly share code, notes, and snippets.

@AndrewAllison
Created July 10, 2020 08:32
Show Gist options
  • Save AndrewAllison/5aa4b907612e92354874923c2fcd4c48 to your computer and use it in GitHub Desktop.
Save AndrewAllison/5aa4b907612e92354874923c2fcd4c48 to your computer and use it in GitHub Desktop.
Gists relating to yml for azure devops
trigger:
- master
- develop
- feature/*
pool:
vmImage: 'windows-2019'
variables:
configuration: 'Release'
projectPath: '**\*.csproj'
testProjectPath: '**\*.Tests.csproj'
majorMinorVersion: 1.0
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- task: UseNode@1
displayName: 'Installing Node 10.x'
inputs:
version: '10.x'
- task: Npm@1
displayName: 'Npm install'
inputs:
workingDir: './HangFire.Api/client'
command: 'install'
- task: SemanticVersioning@1
displayName: 'Creating semanticVersion'
inputs:
configFile: '.semver.yml'
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.5.1
checkLatest: true
- task: UseDotNet@2
displayName: 'Installing .NET core SDK'
inputs:
packageType: 'sdk'
version: '3.1.x'
- task: NuGetAuthenticate@0
displayName: Nuget auth before Restore
- task: NuGetCommand@2
displayName: Nuget Restore
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'
- task: DotNetCoreCLI@2
displayName: 'Building project'
inputs:
command: 'build'
projects: '$(projectPath)'
- task: DotNetCoreCLI@2
displayName: 'Running Tests'
inputs:
command: 'test'
projects: '$(testProjectPath)'
testRunTitle: 'HangFire.jobs.Tests'
- task: DotNetCoreCLI@2
displayName: 'dotnet publish --configuration $(BuildConfiguration)'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true
- task: PublishBuildArtifacts@1
displayName: 'Publish the Package'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
trigger:
- master
- develop
- feature/*
pool:
vmImage: 'windows-2019'
variables:
configuration: 'Release'
projectPath: '<either-path to or wildcard for projFiles>.csproj'
majorMinorVersion: 1.0
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- task: UseDotNet@2
displayName: 'Installing .NET core SDK'
inputs:
packageType: 'sdk'
version: '3.1.x'
- task: DotNetCoreCLI@2
displayName: 'Building project'
inputs:
command: 'build'
projects: '$(projectPath)'
- task: SemanticVersioning@1
displayName: 'Creating semanticVersion'
inputs:
configFile: '.semver.yml'
- script: "echo $(Build.BuildNumber)"
- task: DotNetCoreCLI@2
displayName: 'Packing up the project'
inputs:
command: 'pack'
packagesToPack: '$(projectPath)'
configuration: 'Release'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'Build.BuildNumber'
- task: PublishBuildArtifacts@1
displayName: 'Publish the Package'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
trigger:
- master
- develop
- feature/*
pool:
vmImage: 'windows-2019'
variables:
configuration: 'Release'
projectPath: 'path1.csproj'
commonProjectPath: 'FOLDER\PROJECT-FILE.csproj'
sageProjectPath: 'FOLDER2\PROJECT2-FILE.csproj'
testProjectPath: 'FOLDER\PROJECT-FILE.Tests.csproj'
majorMinorVersion: 1.0
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.5.1
checkLatest: true
- task: UseDotNet@2
displayName: 'Installing .NET core SDK'
inputs:
packageType: 'sdk'
version: '3.1.x'
- task: NuGetAuthenticate@0
displayName: Nuget auth before Restore
- task: NuGetCommand@2
displayName: Nuget Restore
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'
- task: DotNetCoreCLI@2
displayName: 'Building project'
inputs:
command: 'build'
projects: '**/*.sln'
- task: DotNetCoreCLI@2
displayName: 'Running Tests'
inputs:
command: 'test'
projects: '$(testProjectPath)'
testRunTitle: 'Running.Tests'
- task: SemanticVersioning@1
displayName: 'Creating semanticVersion'
inputs:
configFile: '.semver.yml'
- script: "echo $(Build.BuildNumber)"
- task: DotNetCoreCLI@2
displayName: 'Packing up the project'
inputs:
command: 'pack'
packagesToPack: '$(projectPath)'
configuration: 'Release'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'Build.BuildNumber'
- task: DotNetCoreCLI@2
displayName: 'Packing up the common orders'
inputs:
command: 'pack'
packagesToPack: '$(commonProjectPath)'
configuration: 'Release'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'Build.BuildNumber'
- task: DotNetCoreCLI@2
displayName: 'Packing up the Sage'
inputs:
command: 'pack'
packagesToPack: '$(sageProjectPath)'
configuration: 'Release'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'Build.BuildNumber'
- task: PublishBuildArtifacts@1
displayName: 'Publish the Package'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment