Skip to content
Snippets Groups Projects
Commit e6d8fabb authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add more information to update marker file

In addition to the previously added package name / path, the marker file
now gets populated with the following:

- host name (redundant, but easy to parse from here)
- the time stamp when the update happened
- build commit
- build configuration

The encoding of the file is changed to be ASCII, otherwise PowerShell always
places the ugly BOM (byte-order-mark) at the beginning, confusing a lot of
editors.

Fixes #46
parent 5f138e6a
No related branches found
No related tags found
No related merge requests found
......@@ -449,8 +449,26 @@ function Update-ServiceBinaries {
$MarkerFile = "$($UpdPathMarkerFiles)\$($env:COMPUTERNAME)"
try {
try {
$BuildCommit = Get-Content $UpdPackage\BuildCommit.txt
}
catch {
$BuildCommit = "UNKNOWN"
}
try {
$BuildConfig = Get-Content $UpdPackage\BuildConfiguration.txt
}
catch {
$BuildConfig = "UNKNOWN"
}
New-Item -Type File "$MarkerFile" | Out-Null
Write-Output "Installed package: $($UpdPackage)" | Out-File $MarkerFile
Write-Output "$($Me): running AutoTx service update" `
" - Host: $($env:COMPUTERNAME)" `
" - Updater Run Timestamp: $(Get-Date -Format o)" `
" - Build Commit: $($BuildCommit)" `
" - Build Configuration: $($BuildConfig)" `
" - Package Name: $($UpdPackage)" `
| Out-File -Encoding ASCII $MarkerFile
Log-Debug "Created marker file [$($MarkerFile)]."
}
catch {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment