73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
# ASP.NET Core
|
|
|
|
name: 'RepoAPI.$(Build.SourceBranchName).$(Date:yyyyMMdd)$(Rev:.r)'
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- '*'
|
|
|
|
pool:
|
|
name: LCUOnPrem
|
|
|
|
variables:
|
|
buildConfiguration: 'Release'
|
|
|
|
steps:
|
|
- task: DotNetCoreCLI@2
|
|
inputs:
|
|
command: 'restore'
|
|
feedsToUse: 'select'
|
|
vstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
inputs:
|
|
command: 'build'
|
|
projects: '**/*.csproj'
|
|
arguments: '--configuration $(buildConfiguration)'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Test
|
|
inputs:
|
|
command: test
|
|
projects: '**/*Tests.csproj'
|
|
arguments: '--configuration $(BuildConfiguration) --collect "Code coverage"'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'dotnet publish $(buildConfiguration)'
|
|
inputs:
|
|
command: 'publish'
|
|
publishWebProjects: false
|
|
projects: '**/*.csproj'
|
|
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
|
|
|
|
- task: MSBuild@1
|
|
displayName: Build sql project
|
|
inputs:
|
|
solution: './LCU.API.Collections.RepoApiSql/LCU.API.Collections.RepoApiSql.sqlproj'
|
|
configuration: 'Release'
|
|
|
|
- task: CopyFiles@2
|
|
displayName: Copy dacpac to artifact staging directory
|
|
inputs:
|
|
SourceFolder: './LCU.API.Collections.RepoApiSql/bin/$(BuildConfiguration)/'
|
|
Contents: 'LCU.API.Collections.RepoApiSql.dacpac'
|
|
TargetFolder: '$(build.artifactstagingdirectory)'
|
|
OverWrite: true
|
|
|
|
- task: NuGetCommand@2
|
|
displayName: 'NuGet push'
|
|
inputs:
|
|
command: push
|
|
packagesToPush: 'LCU.Shared.Collections.RepoApiLib/**/*.nupkg'
|
|
publishVstsFeed: '58ebbac4-8e98-4281-bb3f-58003852f4a7'
|
|
allowPackageConflicts: true
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
condition: and (succeeded(), or( eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'master')) )
|
|
displayName: 'Publish Artifact: dist'
|
|
inputs:
|
|
PathtoPublish: '$(build.artifactstagingdirectory)'
|
|
ArtifactName: 'dist'
|
|
|
|
|