|
| 1 | +# ASP.NET Core |
| 2 | +# Build and test ASP.NET Core projects targeting .NET Core. |
| 3 | +# Add steps that run tests, create a NuGet package, deploy, and more: |
| 4 | +# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core |
| 5 | + |
| 6 | +trigger: |
| 7 | +- master |
| 8 | + |
| 9 | +variables: |
| 10 | + BuildConfiguration: 'Release' |
| 11 | + |
| 12 | +jobs: |
| 13 | + |
| 14 | + - job: 'net_core' |
| 15 | + displayName: '.NET Core Build' |
| 16 | + pool: |
| 17 | + vmImage: 'ubuntu-latest' |
| 18 | + steps: |
| 19 | + - task: DotNetCoreCLI@2 |
| 20 | + displayName: '.NET Core - Restore' |
| 21 | + inputs: |
| 22 | + command: 'restore' |
| 23 | + projects: './src' |
| 24 | + feedsToUse: 'select' |
| 25 | + |
| 26 | + - task: DotNetCoreCLI@2 |
| 27 | + displayName: '.NET Core - Build' |
| 28 | + inputs: |
| 29 | + command: 'build' |
| 30 | + arguments: '-c $(BuildConfiguration) --no-restore' |
| 31 | + projects: './src' |
| 32 | + |
| 33 | + - task: DotNetCoreCLI@2 |
| 34 | + displayName: '.NET Core - Run Tests' |
| 35 | + inputs: |
| 36 | + command: 'test' |
| 37 | + projects: './src' |
| 38 | + |
| 39 | + - task: DotNetCoreCLI@2 |
| 40 | + displayName: 'Publish - API' |
| 41 | + inputs: |
| 42 | + command: 'publish' |
| 43 | + publishWebProjects: false |
| 44 | + projects: '**/JPProject.Admin.Api.csproj' |
| 45 | + arguments: '-c $(BuildConfiguration) -o $(Build.StagingDirectory)/api --no-build' |
| 46 | + zipAfterPublish: false |
| 47 | + modifyOutputPath: false |
| 48 | + workingDirectory: './src/Backend/JPProject.Admin.Api' |
| 49 | + |
| 50 | + - task: ArchiveFiles@2 |
| 51 | + displayName: 'Zip - API' |
| 52 | + inputs: |
| 53 | + rootFolderOrFile: '$(Build.StagingDirectory)/api/' |
| 54 | + includeRootFolder: false |
| 55 | + archiveType: 'zip' |
| 56 | + archiveFile: '$(Build.ArtifactStagingDirectory)/jpproject.api.$(Build.BuildNumber).zip' |
| 57 | + replaceExistingArchive: true |
| 58 | + |
| 59 | + - task: PublishBuildArtifacts@1 |
| 60 | + displayName: 'Artifact - Generate API' |
| 61 | + inputs: |
| 62 | + PathtoPublish: '$(Build.ArtifactStagingDirectory)/jpproject.api.$(Build.BuildNumber).zip' |
| 63 | + ArtifactName: 'jpproject.api.$(Build.BuildNumber)' |
| 64 | + publishLocation: 'Container' |
| 65 | + |
| 66 | + # Angular APP |
| 67 | + - job: 'angular' |
| 68 | + displayName: 'Angular Build' |
| 69 | + pool: |
| 70 | + vmImage: 'ubuntu-latest' |
| 71 | + steps: |
| 72 | + # Admin UI |
| 73 | + - task: Npm@1 |
| 74 | + displayName: 'NPM - Install - AdminUI' |
| 75 | + inputs: |
| 76 | + command: install |
| 77 | + workingDir: src/Frontend/Jp.AdminUI |
| 78 | + |
| 79 | + - task: Npm@1 |
| 80 | + displayName: 'NPM - Build Prod - AdminUI' |
| 81 | + inputs: |
| 82 | + command: custom |
| 83 | + customCommand: 'run build -- --base-href=/admin-ui/' |
| 84 | + workingDir: src/Frontend/Jp.AdminUI |
| 85 | + |
| 86 | + - task: ArchiveFiles@2 |
| 87 | + displayName: 'ZIP - AdminUI' |
| 88 | + inputs: |
| 89 | + rootFolderOrFile: 'src/Frontend/Jp.AdminUI/dist/' |
| 90 | + includeRootFolder: false |
| 91 | + archiveType: 'zip' |
| 92 | + archiveFile: '$(Build.ArtifactStagingDirectory)/jpproject.admin-ui.$(Build.BuildNumber).zip' |
| 93 | + replaceExistingArchive: true |
| 94 | + |
| 95 | + - task: PublishBuildArtifacts@1 |
| 96 | + displayName: 'Artifact - Generate - AdminUI' |
| 97 | + inputs: |
| 98 | + PathtoPublish: '$(Build.ArtifactStagingDirectory)/jpproject.admin-ui.$(Build.BuildNumber).zip' |
| 99 | + ArtifactName: 'jpproject.admin-ui.$(Build.BuildNumber)' |
| 100 | + publishLocation: 'Container' |
0 commit comments