Initializr/azure-pipelines.yml

91 строка
2.9 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'
sourceDir: 'src/Steeltoe.Initializr.WebApp'
templateDir: 'src/templates'
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: $(sourceDir)
- 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: '$(sourceDir)/manifest.yml'
additionalDeployArgs: '-p bin/Debug/netcoreapp2.2/ubuntu.14.04-x64/publish'
createServices: false
bindServices: false
workingDirectory: $(sourceDir)
- 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: '$(sourceDir)/manifest-dev.yml'
additionalDeployArgs: '-p bin/Debug/netcoreapp2.2/ubuntu.14.04-x64/publish'
createServices: false
bindServices: false
workingDirectory: '$(sourceDir)'