118 строки
3.7 KiB
YAML
118 строки
3.7 KiB
YAML
# ASP.NET Core (.NET Framework)
|
|
# Build and test ASP.NET Core projects targeting the full .NET Framework.
|
|
# Add steps that publish symbols, save build artifacts, and more:
|
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
|
|
|
|
trigger:
|
|
- master
|
|
- dev
|
|
|
|
variables:
|
|
solution: '**/*.sln'
|
|
buildPlatform: 'Any CPU'
|
|
buildConfiguration: 'Release'
|
|
|
|
stages:
|
|
- stage: Initializr_Website
|
|
jobs:
|
|
- job: BuildTestAndPublishJob
|
|
displayName: Build Test and Publish to PWS
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
steps:
|
|
- task: UseDotNet@2
|
|
inputs:
|
|
packageType: 'sdk'
|
|
useGlobalJson: false
|
|
version: 2.2.101
|
|
- task: UseDotNet@2
|
|
inputs:
|
|
packageType: 'sdk'
|
|
useGlobalJson: true
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Dotnet build
|
|
inputs:
|
|
command: 'build'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Dotnet test (Unit Tests)
|
|
inputs:
|
|
command: 'test'
|
|
arguments: '--filter Category!=Integration'
|
|
testRunTitle: 'Unit Tests'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Dotnet test (Integration Tests)
|
|
inputs:
|
|
command: 'test'
|
|
arguments: '--filter Category=Integration'
|
|
testRunTitle: 'Integration Tests'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Dotnet publish
|
|
inputs:
|
|
command: 'publish'
|
|
publishWebProjects: false
|
|
arguments: '-f netcoreapp2.2 -r ubuntu.14.04-x64'
|
|
zipAfterPublish: false
|
|
modifyOutputPath: false
|
|
workingDirectory: 'src'
|
|
- task: CloudFoundryCLIInstall@0
|
|
displayName: Install CF Cli
|
|
inputs:
|
|
cfVersion: '6.43.0'
|
|
- task: CloudFoundry@1
|
|
displayName: publish to Prod
|
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
|
inputs:
|
|
cfEndpoint: 'PWS-initializr'
|
|
skipSSLValidation: true
|
|
org: 'steeltoe.io'
|
|
space: 'steeltoe.io'
|
|
deploymentOptions: 'manifest'
|
|
cfManifest: 'src/manifest.yml'
|
|
additionalDeployArgs: '-p bin/Debug/netcoreapp2.2/ubuntu.14.04-x64/publish'
|
|
createServices: false
|
|
bindServices: false
|
|
workingDirectory: 'src'
|
|
- task: CloudFoundry@1
|
|
displayName: publish to Staging
|
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
|
|
inputs:
|
|
cfEndpoint: 'PWS-initializr'
|
|
skipSSLValidation: true
|
|
org: 'steeltoe.io'
|
|
space: 'development'
|
|
deploymentOptions: 'manifest'
|
|
cfManifest: 'src/manifest-dev.yml'
|
|
additionalDeployArgs: '-p bin/Debug/netcoreapp2.2/ubuntu.14.04-x64/publish'
|
|
createServices: false
|
|
bindServices: false
|
|
workingDirectory: 'src'
|
|
- stage: template_nugets
|
|
jobs:
|
|
- job: PackAndPublishNuget
|
|
displayName: Build and Publish Template Nugets
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
steps:
|
|
- script: 'cd templates/DotNetTemplating/2.x'
|
|
|
|
- task: UseDotNet@2
|
|
inputs:
|
|
packageType: 'sdk'
|
|
useGlobalJson: true
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Dotnet build
|
|
inputs:
|
|
command: 'build'
|
|
workingDirectory: 'templates/DotNetTemplating/2.x'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Dotnet pack
|
|
inputs:
|
|
command: 'pack'
|
|
packagesToPack: 'templates/DotNetTemplating/2.x/TemplatePack.csproj'
|
|
versioningScheme: 'off'
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
ArtifactName: '2.x_nugets'
|