Created
March 19, 2020 06:22
-
-
Save eegeeZA/f032549ae86c940e4584b4c94a11251c to your computer and use it in GitHub Desktop.
Azure Pipeline example for .NET Core + NPM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger: | |
batch: true | |
branches: | |
include: | |
- develop | |
- release/v* | |
- hotfix/v* | |
- master | |
pool: | |
vmImage: 'windows-latest' | |
variables: | |
BuildConfiguration: 'Release' | |
steps: | |
- task: GitVersion@5 | |
inputs: | |
runtime: 'core' | |
- task: Npm@1 | |
displayName: 'npm install-ci-test' | |
inputs: | |
command: 'custom' | |
workingDir: 'ChooseAFolder.Website/ClientApp' | |
customCommand: 'install-ci-test' | |
- task: PublishTestResults@2 | |
condition: succeededOrFailed() | |
inputs: | |
testResultsFormat: 'JUnit' | |
testResultsFiles: '**/TESTS-*.xml' | |
- task: Npm@1 | |
displayName: 'npm run build' | |
inputs: | |
command: 'custom' | |
workingDir: 'ChooseAFolder.Website/ClientApp' | |
customCommand: 'run build' | |
- task: DotNetCoreCLI@2 | |
displayName: 'dotnet test' | |
inputs: | |
command: 'test' | |
projects: 'ChooseAFolder.sln' | |
arguments: '-c $(BuildConfiguration) --filter Category!=Integration' | |
- task: DotNetCoreCLI@2 | |
displayName: 'dotnet publish SomeProjectName.Website.csproj' | |
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) | |
inputs: | |
command: 'publish' | |
publishWebProjects: false | |
projects: 'ChooseAFolder.Website/SomeProjectName.Website.csproj' | |
arguments: '-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory) /p:Version=$(Build.BuildNumber)' | |
- task: DotNetCoreCLI@2 | |
displayName: 'dotnet publish SomeProjectName.DbUp.csproj' | |
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) | |
inputs: | |
command: 'publish' | |
publishWebProjects: false | |
projects: 'ChooseAFolder.DbUp/SomeProjectName.DbUp.csproj' | |
arguments: '-c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory) /p:Version=$(Build.BuildNumber)' | |
- task: PublishBuildArtifacts@1 | |
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) | |
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