-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathazure-build-image.yml
84 lines (73 loc) · 2.33 KB
/
azure-build-image.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
parameters:
name: ''
buildTargets: 'All'
pushTargets: 'All'
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: Windows-2019
# Use maximum timeout, ie. 6 hours
timeoutInMinutes: 0
steps:
- powershell: |
$password = ConvertTo-SecureString -String $env:storageAccountKey -AsPlainText -Force;
$credential = New-Object System.Management.Automation.PSCredential -ArgumentList "AZURE\$($env:storageAccountName)", $password;
New-PSDrive -Name Z -PSProvider FileSystem -Root "$env:storageAccountLocation" -Credential $credential -Persist;
env:
storageAccountKey: $(storageAccountKey)
storageAccountName: $(storageAccountName)
storageAccountLocation: $(storageAccountLocation)
displayName: Mount Files
- task: CopyFiles@2
displayName: Copy XP files
inputs:
sourceFolder: Z:/xp/9.2.0
targetFolder: files
cleanTargetFolder: true
- task: CopyFiles@2
displayName: Copy XC files
inputs:
sourceFolder: Z:/xc/9.2.0
targetFolder: files
cleanTargetFolder: false
- task: CopyFiles@2
displayName: Copy certificates
inputs:
sourceFolder: Z:/certificates
targetFolder: files
cleanTargetFolder: false
- task: CopyFiles@2
displayName: Copy XC license
inputs:
sourceFolder: Z:/
targetFolder: xc/license/
contents: license.xml
cleanTargetFolder: true
- task: CopyFiles@2
displayName: Copy XP license
inputs:
sourceFolder: Z:/
targetFolder: xp/license/
contents: license.xml
cleanTargetFolder: true
- powershell: |
If (Test-Path ./files/*.pfx) { Write-Host "Re-using found certificates"; ls ./files/*.pfx } Else { ./Generate-Certificates.ps1 }
displayName: Generate certificates
- task: PowerShell@2
displayName: Build images
inputs:
targetType: 'filePath'
filePath: build.ps1
arguments: ${{ parameters.buildTargets }}
- task: Docker@1
displayName: Container registry login
inputs:
command: login
azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
azureContainerRegistry: $(azureContainerRegistry)
- task: PowerShell@2
displayName: (Optionally) Push images
inputs:
targetType: 'filePath'
filePath: build.ps1
arguments: ${{ parameters.pushTargets }} --RepoImagePrefix $(dockerId)