Files
runner-images/images.CI/download-repo.ps1
Maksim Petrov f97706e248 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
2020-08-24 12:31:51 +03:00

14 lines
458 B
PowerShell

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