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:
@@ -0,0 +1,14 @@
|
||||
param(
|
||||
[String] [Parameter (Mandatory=$true)] $RepoUrl,
|
||||
[String] [Parameter (Mandatory=$true)] $RepoBranch
|
||||
)
|
||||
|
||||
Write-Host "Clean up default repository"
|
||||
Remove-Item -path './*' -Recurse -Force
|
||||
|
||||
Write-Host "Download ${RepoBranch} branch from ${RepoUrl}"
|
||||
$env:GIT_REDIRECT_STDERR = '2>&1'
|
||||
git clone $RepoUrl . -b $RepoBranch --single-branch --depth 1
|
||||
|
||||
Write-Host "Latest commit:"
|
||||
git log --pretty=format:"Date: %cd; Commit: %H - %s; Author: %an <%ae>" -1
|
||||
Reference in New Issue
Block a user