-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines-unix.yml
95 lines (90 loc) · 4.59 KB
/
azure-pipelines-unix.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
name: '$(Rev:r)'
stages:
- stage: buildStage
displayName: Build Stage
pool:
vmImage: $(MANAGEMENT_VM_IMAGE)
name: $(MANAGEMENT_AGENT_NAME)
jobs:
-
job: "buildJob"
displayName: "Build Job"
steps:
- task: DownloadSecureFile@1
inputs:
secureFile: 'data-on-demand.snk'
name: STRONGNAME_KEY
displayName: "Download secure file"
- task: PowerShell@2
displayName: Download VSAE
name: downloadVSAE
inputs:
targetType: inline
script: |
$s3URI = "https://s3.amazonaws.com/releases.squaredup/squaredupltd/tools%26scripts/vsae-msi/VisualStudio2022AuthoringConsole_x64_v1.4.1.1.msi"
$file = "$(System.DefaultWorkingDirectory)\VisualStudio2022AuthoringConsole_x64_v1.4.1.1.msi"
Write-Host "Downloading Build from $s3URI to $file"
(New-Object System.Net.WebClient).DownloadFile($s3URI, $file)
Get-ChildItem $(System.DefaultWorkingDirectory)
Write-Host "##vso[task.setvariable variable=VSAE_InstallerPath]$file"
failOnStderr: true
- task: PowerShell@2
displayName: Install VSAE
name: installVSAE
inputs:
targetType: inline
script: |
$file = "$(VSAE_InstallerPath)"
$DataStamp = get-date -Format yyyyMMddTHHmmss
$logFile = '{0}-{1}.log' -f $file,$DataStamp
$MSIArguments = @(
"/i"
('"{0}"' -f $file)
"/qn"
"/norestart"
"/L*v"
$logFile
)
Write-Host "Installing Visual Studio Authoring Extensions"
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow
Write-host "##vso[task.uploadfile]$logFile"
failOnStderr: true
- task: VSBuild@1
displayName: "Visual Studio Build"
inputs:
solution: "$(buildsolutionFile)"
vsVersion: "17.0"
msbuildArgs: '/verbosity:minimal /p:Version=$(DEMAND_MAJOR_VERSION).$(DEMAND_MINOR_VERSION).$(DEMAND_REVISION).$(BUILD_NUMBER) /p:AssemblyOriginatorKeyFile=$(STRONGNAME_KEY.secureFilePath)'
platform: "$(buildPlatform)"
configuration: "$(buildConfiguration)"
clean: true
msbuildArchitecture: "x86"
createLogFile: true
logFileVerbosity: "detailed"
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'ManagementPacks\Community.DataOnDemand.Unix\bin\Release\Community.DataOnDemand.Unix.mpb'
artifact: 'Community.DataOnDemand.Unix.MP'
publishLocation: 'pipeline'
- powershell: |
try {
Write-Host "Configuring AWS Credentials"
aws configure set aws_access_key_id $env:AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $env:AWS_SECRET_ACCESS_KEY
aws configure set default.region us-east-1
Write-Host "Successfully Configured AWS Credentials"
Write-Host "Starting Upload"
aws s3 cp "$(System.DefaultWorkingDirectory)\ManagementPacks\Community.DataOnDemand.Unix\bin\Release\Community.DataOnDemand.Unix.mpb" "s3://cibuilds.squaredup/management-packs/Community.DataOnDemand.Unix/$(DEMAND_MAJOR_VERSION).$(DEMAND_MINOR_VERSION).$(DEMAND_REVISION)/Community.DataOnDemand.Unix-$(DEMAND_MAJOR_VERSION).$(DEMAND_MINOR_VERSION).$(DEMAND_REVISION)-$(BUILD_NUMBER).mpb"
Write-Host "Artifacts Uploaded to S3"
}
catch {
Write-Host "Failed to Upload Artifact"
Write-Host $_.scriptstackTrace
Write-Host "Response : $_.Exception.Response"
exit -1
}
workingDirectory: '$(System.DefaultWorkingDirectory)'
env:
AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
displayName: Upload Artifacts to S3