mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 12:06:59 +00:00
Add current commit into logs for custom builds (#1419)
* Show latest commit for custom repos * Remove unused variables from templates * Add Get-LatestCommit function * Fix in synopsis * Remove SSH_Password variables from Windows Images * Rename download-customrepo * Fix in synopsis
This commit is contained in:
@@ -39,6 +39,16 @@ Function Get-PackerTemplatePath {
|
||||
return $RepositoryRoot + $relativePath;
|
||||
}
|
||||
|
||||
Function Get-LatestCommit {
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
|
||||
process {
|
||||
Write-Host "Latest commit:"
|
||||
git log --pretty=format:"Date: %cd; Commit: %H - %s; Author: %an <%ae>" -1
|
||||
}
|
||||
}
|
||||
|
||||
Function GenerateResourcesAndImage {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
@@ -170,6 +180,8 @@ Function GenerateResourcesAndImage {
|
||||
$tenantId = $sub.TenantId
|
||||
# "", "Note this variable-setting script for running Packer with these Azure resources in the future:", "==============================================================================================", "`$spClientId = `"$spClientId`"", "`$ServicePrincipalClientSecret = `"$ServicePrincipalClientSecret`"", "`$SubscriptionId = `"$SubscriptionId`"", "`$tenantId = `"$tenantId`"", "`$spObjectId = `"$spObjectId`"", "`$AzureLocation = `"$AzureLocation`"", "`$ResourceGroupName = `"$ResourceGroupName`"", "`$storageAccountName = `"$storageAccountName`"", "`$install_password = `"$install_password`"", ""
|
||||
|
||||
Get-LatestCommit -ErrorAction SilentlyContinue
|
||||
|
||||
packer.exe build -on-error=ask `
|
||||
-var "client_id=$($spClientId)" `
|
||||
-var "client_secret=$($ServicePrincipalClientSecret)" `
|
||||
|
||||
Reference in New Issue
Block a user