Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
93a1772a
Commit
93a1772a
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Rename variables to have common prefixes.
parent
0565dfbf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Updater/Update-Service.ps1
+13
-13
13 additions, 13 deletions
Updater/Update-Service.ps1
with
13 additions
and
13 deletions
Updater/Update-Service.ps1
+
13
−
13
View file @
93a1772a
...
@@ -247,7 +247,7 @@ function Update-Configuration {
...
@@ -247,7 +247,7 @@ function Update-Configuration {
function
Copy
-ServiceFiles
{
function
Copy
-ServiceFiles
{
try
{
try
{
Write-Verbose
"Looking for source package using pattern:
$(
$Pattern
)
"
Write-Verbose
"Looking for source package using pattern:
$(
$Pattern
)
"
$PkgDir
=
Get-ChildItem
-Path
$Updat
e
Binaries
Path
-Directory
-Name
|
$PkgDir
=
Get-ChildItem
-Path
$Upd
P
at
h
Binaries
-Directory
-Name
|
Where-Object
{
$_
-match
$Pattern
}
|
Where-Object
{
$_
-match
$Pattern
}
|
Sort-Object
|
Sort-Object
|
Select-Object
-Last
1
Select-Object
-Last
1
...
@@ -260,7 +260,7 @@ function Copy-ServiceFiles {
...
@@ -260,7 +260,7 @@ function Copy-ServiceFiles {
Stop-MyService
"Trying to update service using package [
$(
$PkgDir
)
]."
Stop-MyService
"Trying to update service using package [
$(
$PkgDir
)
]."
Copy-Item
-Recurse
-Force
-ErrorAction
Stop
`
Copy-Item
-Recurse
-Force
-ErrorAction
Stop
`
-Path
"
$(
$Updat
e
Binaries
Path
)
\
$(
$PkgDir
)
\
$(
$ServiceName
)
\*"
`
-Path
"
$(
$Upd
P
at
h
Binaries
)
\
$(
$PkgDir
)
\
$(
$ServiceName
)
\*"
`
-Destination
"
$InstallationPath
"
-Destination
"
$InstallationPath
"
}
}
catch
{
catch
{
...
@@ -272,7 +272,7 @@ function Copy-ServiceFiles {
...
@@ -272,7 +272,7 @@ function Copy-ServiceFiles {
function
Update
-ServiceBinaries
{
function
Update
-ServiceBinaries
{
$MarkerFile
=
"
$(
$Updat
e
Marker
Path
)
\
$(
$
env
:
COMPUTERNAME
)
"
$MarkerFile
=
"
$(
$Upd
P
at
h
Marker
Files
)
\
$(
$
env
:
COMPUTERNAME
)
"
if
(
Test-Path
"
$MarkerFile
"
-Type
Leaf
)
{
if
(
Test-Path
"
$MarkerFile
"
-Type
Leaf
)
{
Log-Debug
"Found marker [
$(
$MarkerFile
)
], not updating service."
Log-Debug
"Found marker [
$(
$MarkerFile
)
], not updating service."
Return
$False
Return
$False
...
@@ -294,8 +294,8 @@ function Upload-LogFiles {
...
@@ -294,8 +294,8 @@ function Upload-LogFiles {
try
{
try
{
Copy-Item
-Force
-ErrorAction
Stop
`
Copy-Item
-Force
-ErrorAction
Stop
`
-Path
"
$(
$LogPath
)
\service.log"
`
-Path
"
$(
$LogPath
)
\service.log"
`
-Destination
$
LogfileUpload
-Destination
$
UploadPathLogs
Write-Verbose
"Uploaded logfile to [
$(
$
LogfileUpload
)
]."
Log-Debug
"Uploaded logfile to [
$(
$
UploadPathLogs
)
]."
}
}
catch
{
catch
{
Log-Warning
"Uploading logfile FAILED!
`n
$(
$_
.
Exception
.
Message
)
"
Log-Warning
"Uploading logfile FAILED!
`n
$(
$_
.
Exception
.
Message
)
"
...
@@ -411,19 +411,19 @@ Log-Debug "$($Me) started..."
...
@@ -411,19 +411,19 @@ Log-Debug "$($Me) started..."
# first check if the service is installed and running at all
# first check if the service is installed and running at all
Ensure
-ServiceRunning
$ServiceName
Ensure
-ServiceRunning
$ServiceName
$Updat
e
Config
Path
=
"
$(
$UpdateSourcePath
)
\Configs\
$(
$
env
:
COMPUTERNAME
)
"
$Upd
P
at
h
Config
=
"
$(
$UpdateSourcePath
)
\Configs\
$(
$
env
:
COMPUTERNAME
)
"
$Updat
e
Marker
Path
=
"
$(
$UpdateSourcePath
)
\Service\UpdateMarkers"
$Upd
P
at
h
Marker
Files
=
"
$(
$UpdateSourcePath
)
\Service\UpdateMarkers"
$Updat
e
Binaries
Path
=
"
$(
$UpdateSourcePath
)
\Service\Binaries"
$Upd
P
at
h
Binaries
=
"
$(
$UpdateSourcePath
)
\Service\Binaries"
$
LogfileUpload
=
"
$(
$UpdateSourcePath
)
\Logs\
$(
$
env
:
COMPUTERNAME
)
"
$
UploadPathLogs
=
"
$(
$UpdateSourcePath
)
\Logs\
$(
$
env
:
COMPUTERNAME
)
"
Exit
-IfDirMissing
$InstallationPath
"installation"
Exit
-IfDirMissing
$InstallationPath
"installation"
Exit
-IfDirMissing
$LogPath
"log files"
Exit
-IfDirMissing
$LogPath
"log files"
Exit
-IfDirMissing
$ConfigPath
"configuration files"
Exit
-IfDirMissing
$ConfigPath
"configuration files"
Exit
-IfDirMissing
$UpdateSourcePath
"update source"
Exit
-IfDirMissing
$UpdateSourcePath
"update source"
Exit
-IfDirMissing
$Updat
e
Config
Path
"configuration update"
Exit
-IfDirMissing
$Upd
P
at
h
Config
"configuration update"
Exit
-IfDirMissing
$Updat
e
Marker
Path
"update marker"
Exit
-IfDirMissing
$Upd
P
at
h
Marker
Files
"update marker"
Exit
-IfDirMissing
$Updat
e
Binaries
Path
"service binaries update"
Exit
-IfDirMissing
$Upd
P
at
h
Binaries
"service binaries update"
Exit
-IfDirMissing
$
LogfileUpload
"log file target"
Exit
-IfDirMissing
$
UploadPathLogs
"log file target"
# NOTE: Upload-LogFiles is called before AND after the main tasks to make sure
# NOTE: Upload-LogFiles is called before AND after the main tasks to make sure
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment