mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Update azure-pipelines.yml for Azure Pipelines
This commit is contained in:
parent
40f1a3e255
commit
94f9c74423
1 changed files with 8 additions and 18 deletions
|
|
@ -28,7 +28,7 @@ variables:
|
|||
|
||||
stages:
|
||||
- stage: build
|
||||
displayName: Build and Publish
|
||||
displayName: Build and Publish
|
||||
|
||||
jobs:
|
||||
- job: build
|
||||
|
|
@ -37,6 +37,7 @@ stages:
|
|||
steps:
|
||||
- task: PowerShell@2
|
||||
displayName: Create AgentCapabilities Environment Variables
|
||||
enabled: false
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
|
|
@ -58,14 +59,12 @@ stages:
|
|||
}
|
||||
|
||||
$uri = "$($baseUri)/distributedtask/pools?api-version=6.0"
|
||||
Write-Host $uri
|
||||
$responsePools = Invoke-RestMethod -Method Get -Uri $uri -Headers $headers -UseBasicParsing
|
||||
Write-Host $responsePools
|
||||
|
||||
foreach ($pool in $responsePools.Value) {
|
||||
|
||||
$uri = "$($baseUri)/distributedtask/pools/$($pool.Id)/agents?api-version=6.0&includeCapabilities=true"
|
||||
Write-Host $uri
|
||||
$responseAgents = Invoke-RestMethod -Method Get -Uri $uri -Headers $headers -UseBasicParsing
|
||||
Write-Host $responseAgents
|
||||
|
||||
|
|
@ -78,7 +77,6 @@ stages:
|
|||
throw "Multiple agents ($($agents.Count)) found with id: $agentId and name: $agentName"
|
||||
}
|
||||
|
||||
Write-Host -ForeGroundColor Green 'Agent found'
|
||||
return $agents.Item(0)
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +117,7 @@ stages:
|
|||
|
||||
- task: PowerShell@2
|
||||
displayName: Output Environment Variables
|
||||
#condition: contains(variables['system.debug'], 'true')
|
||||
condition: contains(variables['system.debug'], 'true')
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String'
|
||||
|
|
@ -171,13 +169,15 @@ stages:
|
|||
env:
|
||||
BUILD_BUILDNUMBER: $(Build.BuildNumber)
|
||||
BUILD_ARTIFACTSTAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
|
||||
AGENTCAPABILITIES_USER_INNOSETUP: 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
$appVersion = $env:BUILD_BUILDNUMBER
|
||||
$appVersionShort = $appVersion.Substring(0, $appVersion.LastIndexOf('.'))
|
||||
$appVersionWithUnderscores = $appVersion.Replace('.', '_')
|
||||
$publishPath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\bin"
|
||||
$installScriptFile = ".azure/scripts/$(ApplicationName).iss"
|
||||
$installTextFile = '.azure/scripts/Installer.txt'
|
||||
|
||||
$installTextFileContent = @"
|
||||
|
|
@ -187,20 +187,10 @@ stages:
|
|||
#define RootPath "$publishPath"
|
||||
"@
|
||||
$installTextFileContent | Out-File -LiteralPath:$installTextFile -Force -Encoding ascii
|
||||
|
||||
& "$env:AGENTCAPABILITIES_USER_INNOSETUP" /J"$installTextFile" "$installScriptFile"
|
||||
pwsh: true
|
||||
|
||||
- task: Installer@1
|
||||
displayName: 'Install Inno Setup'
|
||||
enabled: false
|
||||
inputs:
|
||||
version: '6.0.5'
|
||||
|
||||
- task: Build@1
|
||||
displayName: 'Build Setup File'
|
||||
enabled: false
|
||||
inputs:
|
||||
file: .azure/scripts/ArkServerManager.iss
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Artifact Files'
|
||||
inputs:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue