mirror of
https://github.com/actions/runner-images.git
synced 2025-12-10 11:07:02 +00:00
[Ubuntu] Implement new directories hierarchy (#8627)
This commit is contained in:
committed by
GitHub
parent
d1f2c9a3be
commit
5d40b1e213
@@ -65,9 +65,9 @@ jobs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
$ImageType = "${{ parameters.image_type }}"
|
||||
$TemplateDirectoryName = if ($ImageType.StartsWith("ubuntu")) { "linux" } else { "windows/templates" }
|
||||
$TemplateDirectoryName = if ($ImageType.StartsWith("ubuntu")) { "ubuntu/templates" } else { "windows/templates" }
|
||||
$TemplateDirectoryPath = Join-Path "images" $TemplateDirectoryName | Resolve-Path
|
||||
|
||||
|
||||
$TemplateFileName = "${{ parameters.image_template_name }}"
|
||||
if ($TemplateFileName) {
|
||||
$TemplatePath = Join-Path $TemplateDirectoryPath $TemplateFileName
|
||||
|
||||
@@ -17,4 +17,5 @@ jobs:
|
||||
- template: image-generation.yml
|
||||
parameters:
|
||||
image_type: ubuntu2004
|
||||
image_readme_name: Ubuntu2004-Readme.md
|
||||
image_readme_name: Ubuntu2004-Readme.md
|
||||
image_template_name: ubuntu-20.04.json
|
||||
|
||||
@@ -17,4 +17,5 @@ jobs:
|
||||
- template: image-generation.yml
|
||||
parameters:
|
||||
image_type: ubuntu2204
|
||||
image_readme_name: Ubuntu2204-Readme.md
|
||||
image_readme_name: Ubuntu2204-Readme.md
|
||||
image_template_name: ubuntu-22.04.pkr.hcl
|
||||
|
||||
@@ -22,7 +22,7 @@ function Validate-Scripts {
|
||||
return $ScriptWithoutShebangLine
|
||||
}
|
||||
|
||||
$PathUbuntu = "./images/linux/scripts"
|
||||
$PathUbuntu = "./images/ubuntu/scripts"
|
||||
$PathMacOS = "./images/macos/provision"
|
||||
$PatternUbuntu = "#!/bin/bash -e"
|
||||
$PatternMacOS = "#!/bin/bash -e -o pipefail"
|
||||
@@ -34,10 +34,10 @@ if ($ScriptsWithBrokenShebang.Length -gt 0) {
|
||||
$ScriptsWithBrokenShebang | ForEach-Object {
|
||||
Write-Host "##[error] '$_'"
|
||||
}
|
||||
Write-Host "`n`n##[error] Expected shebang for scripts in 'images/linux' folder is '$PatternUbuntu'"
|
||||
Write-Host "`n`n##[error] Expected shebang for scripts in 'images/ubuntu' folder is '$PatternUbuntu'"
|
||||
Write-Host "##[error] Expected shebang for scripts in 'images/macos' folder is '$PatternMacOS'"
|
||||
exit 1
|
||||
else {
|
||||
Write-Host "All scripts have correct shebang."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user