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