-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
107 lines (101 loc) · 3.61 KB
/
azure-pipelines.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
96
97
98
99
100
101
102
103
104
105
106
107
trigger:
- master
pool:
name: BuildDeployment
demands:
- Agent.ComputerName -equals S0103BLD1P
steps:
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSource: 'spec'
versionSpec: '16.x'
- task: UseDotNet@2
displayName: 'Install dotnet if not already present'
inputs:
packageType: 'sdk'
version: '9.0.101'
performMultiLevelLookup: false
- task: Npm@1
displayName: 'npm ci'
inputs:
command: custom
workingDir: '$(Build.SourcesDirectory)'
customCommand: ci
- task: PowerShell@2
displayName: 'Generate NuGet.config for IG ProGet NuGet feed'
continueOnError: true
inputs:
targetType: 'inline'
script: |
dotnet new nugetconfig --force
dotnet nuget add source http://proget.infragistics.local:81/nuget/IgniteUINuGet/ --name "IG ProGet NuGet" --allow-insecure-connections
# Manually add the allowInsecureConnections attribute to the nuget.config file
Write-Host "getting config file"
Write-Host "$(Build.SourcesDirectory)\nuget.config"
$nugetConfigPath = "$(Build.SourcesDirectory)\nuget.config"
Write-Host "getting xml content"
[xml]$nugetConfig = Get-Content $nugetConfigPath
$nugetConfig.configuration.packageSources.add | Where-Object { $_.name -eq "IG ProGet NuGet" } | ForEach-Object { $_.allowInsecureConnections = "true" }
# Add credentials to the nuget.config file
Write-Host "current config"
Write-Host $nugetConfig
Write-Host "adding credentials"
$packageSourceCredentials = $nugetConfig.CreateElement("packageSourceCredentials")
Write-Host "adding source"
$source = $nugetConfig.CreateElement("IG_x0020_ProGet_x0020_NuGet")
$addUsername = $nugetConfig.CreateElement("add")
Write-Host "adding username"
$userName = "$(IG_Nuget_Feed_Username)"
Write-Host "username is"
Write-Host "$userName"
$addUsername.SetAttribute("key", "Username")
Write-Host "setting attribute"
$addUsername.SetAttribute("value", $userName)
$source.AppendChild($addUsername)
$addPassword = $nugetConfig.CreateElement("add")
Write-Host "adding password"
$password = "$(IG_Nuget_Feed_Password)"
$addPassword.SetAttribute("key", "ClearTextPassword")
$addPassword.SetAttribute("value", "$password")
$source.AppendChild($addPassword)
$packageSourceCredentials.AppendChild($source)
$nugetConfig.configuration.AppendChild($packageSourceCredentials)
Write-Host "writing contents to file"
$nugetConfig.OuterXml | Set-Content -Path $nugetConfigPath
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)'
- task: CmdLine@1
displayName: 'Run dotnet in blazor app'
inputs:
filename: dotnet
arguments: restore
workingFolder: '$(Build.SourcesDirectory)\app'
- task: CmdLine@1
displayName: 'Run dotnet in blazor app'
inputs:
filename: dotnet
arguments: 'build --force'
workingFolder: '$(Build.SourcesDirectory)\app'
- task: Npm@0
displayName: 'npm install'
inputs:
cwd: '$(Build.SourcesDirectory)'
- task: CmdLine@1
displayName: 'npm run build'
inputs:
filename: npm
arguments: 'run build'
- task: ArchiveFiles@1
displayName: 'Archive files '
inputs:
rootFolder: '$(Build.SourcesDirectory)/_site'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/IgniteUIBlazorAPIDocfx.zip'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: docsAPISite'
inputs:
ArtifactName: docsAPISite
publishLocation: FilePath
TargetPath: '\\infragistics.local\igfiles\Builds\Blazor\$(Build.BuildNumber)'