-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-staging.yml
95 lines (90 loc) · 2.77 KB
/
build-staging.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# 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
resources:
repositories:
- repository: Frontend
type: github
endpoint: Azure Devops OrsoDevOps
name: orso-co/orso-arpa-web-extended
ref: main
trigger:
- staging
trigger:
- develop
pr: none
pool:
vmImage: 'windows-latest'
variables:
- group: arpa-base-urls
- name: backendWorkingDirectory
value: '$(AGENT.BUILDDIRECTORY)\Orso.Arpa.Api'
- name: frontendWorkingDirectory
value: '$(AGENT.BUILDDIRECTORY)\Orso.Arpa.Web'
- name: solution
value: 'Orso.Arpa.Api\**\*.sln'
- name: buildPlatform
value: 'Any CPU'
- name: buildConfiguration
value: 'Release'
- name: frontendOutputPath
value: '..\a\Orso.Arpa.Api\wwwroot'
- name: stage
value: 'staging'
- name: targetFramework
value: '9.0'
steps:
- checkout: self
path: 'Orso.Arpa.Api'
- checkout: Frontend
path: 'Orso.Arpa.Web'
- task: UseDotNet@2
displayName: Use .NET SDK $(targetFramework).x
inputs:
packageType: 'sdk'
version: '$(targetFramework).x'
- task: DotNetCoreCLI@2
displayName: Restore Backend
inputs:
command: restore
projects: '$(backendWorkingDirectory)/**/*.csproj'
- task: DotNetCoreCLI@2
displayName: Build Backend
inputs:
command: build
projects: '$(backendWorkingDirectory)/**/Orso.Arpa.Api.csproj'
arguments: --configuration $(BuildConfiguration) --no-restore
- task: DotNetCoreCLI@2
displayName: Publish Backend
inputs:
command: publish
projects: '$(backendWorkingDirectory)/**/Orso.Arpa.Api.csproj'
publishWebProjects: false
arguments: --configuration $(BuildConfiguration) --output "$(build.artifactstagingdirectory)"
zipAfterPublish: false
- task: NodeTool@0
inputs:
versionSpec: '18.19'
displayName: 'Install Node.js'
- script: npm ci
displayName: 'Install Frontend Dependencies'
workingDirectory: $(frontendWorkingDirectory)
- script: npx ng build --configuration staging --output-path $(frontendOutputPath)
displayName: 'Build Frontend'
workingDirectory: $(frontendWorkingDirectory)
- task: ArchiveFiles@2
displayName: Create .zip File
inputs:
rootFolderOrFile: '$(build.artifactstagingdirectory)/Orso.Arpa.Api'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/Orso.Arpa.Api.zip'
replaceExistingArchive: true
verbose: true
- task: PublishBuildArtifacts@1
displayName: Publish Artifact
inputs:
PathtoPublish: $(build.artifactstagingdirectory)/Orso.Arpa.Api.zip
ArtifactName: 'orso-arpa-$(stage)'
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'