|
3 | 3 | # Add steps that run tests, create a NuGet package, deploy, and more: |
4 | 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core |
5 | 5 |
|
6 | | -pool: |
7 | | - vmImage: 'Ubuntu 16.04' |
| 6 | +trigger: |
| 7 | +- master |
8 | 8 |
|
9 | 9 | variables: |
10 | | - buildConfiguration: 'Release' |
| 10 | + BuildConfiguration: 'Release' |
11 | 11 |
|
12 | | -steps: |
13 | | -- script: dotnet build ./src --configuration $(buildConfiguration) |
14 | | - displayName: 'dotnet build $(buildConfiguration)' |
| 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' |
15 | 38 |
|
16 | | -- script: dotnet test ./src |
17 | | - displayName: 'Running tests' |
| 39 | + - task: DotNetCoreCLI@2 |
| 40 | + displayName: 'Publish - SSO' |
| 41 | + inputs: |
| 42 | + command: 'publish' |
| 43 | + publishWebProjects: false |
| 44 | + projects: '**/Jp.UI.SSO.csproj' |
| 45 | + arguments: '-c $(BuildConfiguration) -o $(Build.StagingDirectory)/sso --no-build' |
| 46 | + zipAfterPublish: false |
| 47 | + modifyOutputPath: false |
| 48 | + workingDirectory: './src/Frontend/Jp.UI.SSO' |
| 49 | + |
| 50 | + - task: DotNetCoreCLI@2 |
| 51 | + displayName: 'Publish - API' |
| 52 | + inputs: |
| 53 | + command: 'publish' |
| 54 | + publishWebProjects: false |
| 55 | + projects: '**/Jp.Management.csproj' |
| 56 | + arguments: '-c $(BuildConfiguration) -o $(Build.StagingDirectory)/api --no-build' |
| 57 | + zipAfterPublish: false |
| 58 | + modifyOutputPath: false |
| 59 | + workingDirectory: './src/Backend/Jp.UserManagement' |
| 60 | + |
| 61 | + - task: ArchiveFiles@2 |
| 62 | + displayName: 'Zip - SSO' |
| 63 | + inputs: |
| 64 | + rootFolderOrFile: '$(Build.StagingDirectory)/sso/' |
| 65 | + includeRootFolder: false |
| 66 | + archiveType: 'zip' |
| 67 | + archiveFile: '$(Build.ArtifactStagingDirectory)/jpproject.sso.$(Build.BuildNumber).zip' |
| 68 | + replaceExistingArchive: true |
| 69 | + |
| 70 | + - task: ArchiveFiles@2 |
| 71 | + displayName: 'Zip - API' |
| 72 | + inputs: |
| 73 | + rootFolderOrFile: '$(Build.StagingDirectory)/api/' |
| 74 | + includeRootFolder: false |
| 75 | + archiveType: 'zip' |
| 76 | + archiveFile: '$(Build.ArtifactStagingDirectory)/jpproject.api.$(Build.BuildNumber).zip' |
| 77 | + replaceExistingArchive: true |
| 78 | + |
| 79 | + - task: PublishBuildArtifacts@1 |
| 80 | + displayName: 'Artifact - Generate SSO' |
| 81 | + inputs: |
| 82 | + PathtoPublish: '$(Build.ArtifactStagingDirectory)/jpproject.sso.$(Build.BuildNumber).zip' |
| 83 | + ArtifactName: 'jpproject.sso.$(Build.BuildNumber)' |
| 84 | + publishLocation: 'Container' |
| 85 | + |
| 86 | + - task: PublishBuildArtifacts@1 |
| 87 | + displayName: 'Artifact - Generate API' |
| 88 | + inputs: |
| 89 | + PathtoPublish: '$(Build.ArtifactStagingDirectory)/jpproject.api.$(Build.BuildNumber).zip' |
| 90 | + ArtifactName: 'jpproject.api.$(Build.BuildNumber)' |
| 91 | + publishLocation: 'Container' |
| 92 | + |
| 93 | + # Angular APP's |
| 94 | + - job: 'angular' |
| 95 | + displayName: 'Angular Build' |
| 96 | + pool: |
| 97 | + vmImage: 'ubuntu-latest' |
| 98 | + steps: |
| 99 | + # Admin UI |
| 100 | + - task: Npm@1 |
| 101 | + displayName: 'NPM - Install - AdminUI' |
| 102 | + inputs: |
| 103 | + command: install |
| 104 | + workingDir: src/Frontend/Jp.AdminUI |
| 105 | + |
| 106 | + - task: Npm@1 |
| 107 | + displayName: 'NPM - Install - UserManagement' |
| 108 | + inputs: |
| 109 | + command: install |
| 110 | + workingDir: src/Frontend/Jp.UserManagement |
| 111 | + |
| 112 | + - task: Npm@1 |
| 113 | + displayName: 'NPM - Build Prod - AdminUI' |
| 114 | + inputs: |
| 115 | + command: custom |
| 116 | + customCommand: 'run build --prod --base-href=/admin-ui/' |
| 117 | + workingDir: src/Frontend/Jp.AdminUI |
| 118 | + |
| 119 | + - task: Npm@1 |
| 120 | + displayName: 'NPM - Build Prod - UserManagement' |
| 121 | + inputs: |
| 122 | + command: custom |
| 123 | + customCommand: 'run build --prod --base-href=/user-management/' |
| 124 | + workingDir: src/Frontend/Jp.UserManagement |
| 125 | + |
| 126 | + - task: CopyFiles@2 |
| 127 | + displayName: 'COPY - web.config - AdminUI' |
| 128 | + inputs: |
| 129 | + SourceFolder: '$(Build.Repository.LocalPath)/build' |
| 130 | + Contents: 'web.config' |
| 131 | + TargetFolder: '$(Build.Repository.LocalPath)/src/Frontend/Jp.AdminUI/dist/' |
| 132 | + |
| 133 | + - task: CopyFiles@2 |
| 134 | + displayName: 'COPY - web.config - UserManagement' |
| 135 | + inputs: |
| 136 | + SourceFolder: '$(Build.Repository.LocalPath)/build' |
| 137 | + Contents: 'web.config' |
| 138 | + TargetFolder: '$(Build.Repository.LocalPath)/src/Frontend/Jp.UserManagement/dist/' |
| 139 | + |
| 140 | + - task: ArchiveFiles@2 |
| 141 | + displayName: 'ZIP - AdminUI' |
| 142 | + inputs: |
| 143 | + rootFolderOrFile: 'src/Frontend/Jp.AdminUI/dist/' |
| 144 | + includeRootFolder: false |
| 145 | + archiveType: 'zip' |
| 146 | + archiveFile: '$(Build.ArtifactStagingDirectory)/jpproject.admin-ui.$(Build.BuildNumber).zip' |
| 147 | + replaceExistingArchive: true |
| 148 | + |
| 149 | + - task: ArchiveFiles@2 |
| 150 | + displayName: 'ZIP - UserManagement' |
| 151 | + inputs: |
| 152 | + rootFolderOrFile: 'src/Frontend/Jp.UserManagement/dist/' |
| 153 | + includeRootFolder: false |
| 154 | + archiveType: 'zip' |
| 155 | + archiveFile: '$(Build.ArtifactStagingDirectory)/jpproject.user-management.$(Build.BuildNumber).zip' |
| 156 | + replaceExistingArchive: true |
| 157 | + |
| 158 | + - task: PublishBuildArtifacts@1 |
| 159 | + displayName: 'Artifact - Generate - AdminUI' |
| 160 | + inputs: |
| 161 | + PathtoPublish: '$(Build.ArtifactStagingDirectory)/jpproject.admin-ui.$(Build.BuildNumber).zip' |
| 162 | + ArtifactName: 'jpproject.admin-ui.$(Build.BuildNumber)' |
| 163 | + publishLocation: 'Container' |
18 | 164 |
|
| 165 | + - task: PublishBuildArtifacts@1 |
| 166 | + displayName: 'Artifact - Generate - UserManagement' |
| 167 | + inputs: |
| 168 | + PathtoPublish: '$(Build.ArtifactStagingDirectory)/jpproject.user-management.$(Build.BuildNumber).zip' |
| 169 | + ArtifactName: 'jpproject.user-management.$(Build.BuildNumber)' |
| 170 | + publishLocation: 'Container' |
0 commit comments