Repository navigation
550 lines (448 loc) · 24.7 KB
/
Copy pathcreaterelease.yml
File metadata and controls
550 lines (448 loc) · 24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
name: Release
on:
release:
types: [published]
jobs:
build:
name: "Release"
env:
ASPNETCORE_ENVIRONMENT: "Production"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install NET 9
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '9.0.x'
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Restore Nuget Packages
run: |
dotnet restore TransactionProcessing.MerchantPos/TransactionProcessing.MerchantPos.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet restore TransactionProcessing.MerchantFileProcessor/TransactionProcessing.MerchantFileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet restore HealthMonitoring/HealthMonitoring/HealthMonitoring.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
- name: Build Code
run: |
dotnet build TransactionProcessing.MerchantPos/TransactionProcessing.MerchantPos.sln --configuration Release
dotnet build TransactionProcessing.MerchantFileProcessor/TransactionProcessing.MerchantFileProcessor.sln --configuration Release
dotnet build HealthMonitoring/HealthMonitoring/HealthMonitoring.sln --configuration Release
- name: Publish API
run: |
dotnet publish "TransactionProcessing.MerchantPos/TransactionProcessing.MerchantPos.csproj" --configuration Release --output TransactionProcessing.MerchantPos/publishOutput -r win-x64 --self-contained -p:Version=${{ steps.get_version.outputs.VERSION }} -p:AssemblyVersion=${{ steps.get_version.outputs.VERSION }} -p:FileVersion=${{ steps.get_version.outputs.VERSION }} -p:InformationalVersion=${{ steps.get_version.outputs.VERSION }}
dotnet publish "TransactionProcessing.MerchantFileProcessor/TransactionProcessing.MerchantFileProcessor.csproj" --configuration Release --output TransactionProcessing.MerchantFileProcessor/publishOutput -r win-x64 --self-contained -p:Version=${{ steps.get_version.outputs.VERSION }} -p:AssemblyVersion=${{ steps.get_version.outputs.VERSION }} -p:FileVersion=${{ steps.get_version.outputs.VERSION }} -p:InformationalVersion=${{ steps.get_version.outputs.VERSION }}
dotnet publish "HealthMonitoring/HealthMonitoring/HealthMonitoring.csproj" --configuration Release --output HealthMonitoring/publishOutput -r win-x64 --self-contained -p:Version=${{ steps.get_version.outputs.VERSION }} -p:AssemblyVersion=${{ steps.get_version.outputs.VERSION }} -p:FileVersion=${{ steps.get_version.outputs.VERSION }} -p:InformationalVersion=${{ steps.get_version.outputs.VERSION }}
dotnet publish "ScheduledTasks/DailySupportCheck/KurrentDbClient/KurrentDbClient.csproj" --configuration Release --output ScheduledTasks/DailySupportCheck/KurrentDbClient/publishOutput --no-self-contained
- name: Build Release Package (Merchant Pos)
run: |
cd /home/runner/work/SupportTools/SupportTools/TransactionProcessing.MerchantPos/publishOutput
zip -r ../merchantpos.zip ./*
echo "Zip file created at: $(realpath ../merchantpos.zip)"
- name: Upload the artifact (Merchant Pos)
uses: actions/upload-artifact@v4.4.0
with:
name: merchantpos
path: /home/runner/work/SupportTools/SupportTools/TransactionProcessing.MerchantPos/merchantpos.zip
- name: Build Release Package (Merchant File Processor)
run: |
cd /home/runner/work/SupportTools/SupportTools/TransactionProcessing.MerchantFileProcessor/publishOutput
zip -r ../merchantfileprocessor.zip ./*
echo "Zip file created at: $(realpath ../merchantfileprocessor.zip)"
- name: Upload the artifact (Merchant File Processor)
uses: actions/upload-artifact@v4.4.0
with:
name: merchantfileprocessor
path: /home/runner/work/SupportTools/SupportTools/TransactionProcessing.MerchantFileProcessor/merchantfileprocessor.zip
- name: Upload ScheduledTasks
uses: actions/upload-artifact@v4.4.0
with:
name: scheduledtasks
path: ScheduledTasks
- name: Build Release Package (Health Monitoring)
run: |
cd /home/runner/work/SupportTools/SupportTools/HealthMonitoring/publishOutput
zip -r ../healthmonitoring.zip ./*
echo "Zip file created at: $(realpath ../healthmonitoring.zip)"
- name: Upload the artifact (Health Monitoring)
uses: actions/upload-artifact@v4.4.0
with:
name: healthmonitoring
path: /home/runner/work/SupportTools/SupportTools/HealthMonitoring/healthmonitoring.zip
- name: Build and Publish Nuget Packages
if: ${{ github.event.release.prerelease == false }}
run: |
dotnet pack "HealthMonitoring\HealthMonitoring.Client\HealthMonitoring.Client.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets
dotnet nuget push Nugets/HealthMonitoring.Client.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }} --skip-duplicate
buildsqlagentjobdeploymenttool:
name: "Build SQL Agent Job Deployment Tool"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install NET 10
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '10.0.x'
- name: Publish SQL Agent Job Deployment Tool
shell: pwsh
run: |
dotnet publish SqlServerAgentJobDeploymentTool/SqlServerAgentJobDeploymentTool.csproj `
--configuration Release `
--runtime win-x64 `
--self-contained true `
--output SqlServerAgentJobDeploymentTool/publishOutput
- name: Build Release Package (SQL Agent Job Deployment Tool)
shell: pwsh
run: |
Compress-Archive `
-Path SqlServerAgentJobDeploymentTool/publishOutput/* `
-DestinationPath SqlServerAgentJobDeploymentTool/sqlagentjobdeploymenttool.zip `
-Force
- name: Upload the artifact (SQL Agent Job Deployment Tool)
uses: actions/upload-artifact@v4.4.0
with:
name: sqlagentjobdeploymenttool
path: SqlServerAgentJobDeploymentTool/sqlagentjobdeploymenttool.zip
deploystaging:
runs-on: [stagingserver, windows]
needs: [build, buildsqlagentjobdeploymenttool]
environment: staging
name: "Deploy to Staging"
steps:
- name: Download ScheduledTasks
uses: actions/download-artifact@v4.1.8
with:
name: scheduledtasks
path: ${{ runner.temp }}\scheduledtasks
- name: Install scheduled tasks
shell: powershell
env:
SCHEDULED_TASK_USER: ${{ secrets.SCHEDULED_TASK_USER }}
SCHEDULED_TASK_PASSWORD: ${{ secrets.SCHEDULED_TASK_PASSWORD }}
run: |
$taskScriptDir = 'C:\txnproc\transactionprocessing\powershell'
$scheduledTasksDownloadRoot = Join-Path $env:RUNNER_TEMP 'scheduledtasks'
$scheduledTasksRoot = Join-Path $scheduledTasksDownloadRoot 'ScheduledTasks'
if (-not (Test-Path $scheduledTasksRoot)) {
$scheduledTasksRoot = $scheduledTasksDownloadRoot
}
New-Item -ItemType Directory -Path $taskScriptDir -Force | Out-Null
Get-ChildItem -Path $scheduledTasksRoot -Recurse -Filter *.ps1 |
Where-Object { $_.FullName -notmatch '\\Tests\\' } |
Copy-Item -Destination $taskScriptDir -Force
Get-ChildItem -Path $scheduledTasksRoot -Recurse -Filter daily-support-check.json |
Where-Object { $_.FullName -notmatch '\\Reports\\|\\Tests\\' } |
Copy-Item -Destination $taskScriptDir -Force
$kurrentDbClientOutput = Get-ChildItem -Path $scheduledTasksRoot -Recurse -Directory -Filter publishOutput |
Where-Object { $_.FullName -match '\\DailySupportCheck\\KurrentDbClient\\publishOutput$' } |
Select-Object -First 1
if (-not $kurrentDbClientOutput) {
throw 'Packaged KurrentDB client output was not found in the scheduled-tasks artifact.'
}
$kurrentDbClientDestination = Join-Path $taskScriptDir 'KurrentDbClient'
New-Item -ItemType Directory -Path $kurrentDbClientDestination -Force | Out-Null
Copy-Item -Path (Join-Path $kurrentDbClientOutput.FullName '*') -Destination $kurrentDbClientDestination -Recurse -Force
Get-ChildItem -Path $scheduledTasksRoot -Recurse -Filter *.xml |
Where-Object { $_.FullName -notmatch '\\Tests\\' } |
ForEach-Object {
[xml]$taskDefinition = Get-Content -Path $_.FullName -Raw
$taskName = [string]$taskDefinition.Task.RegistrationInfo.URI
if ([string]::IsNullOrWhiteSpace($taskName)) {
$taskName = $_.BaseName
}
$taskName = $taskName.TrimStart('\')
& schtasks.exe /Create /TN $taskName /XML $_.FullName /RU SYSTEM /F
if ($LASTEXITCODE -ne 0) {
throw "Failed to register scheduled task [$taskName] from [$($_.FullName)]"
}
}
- name: Download SQL Agent Job Deployment Tool
uses: actions/download-artifact@v4.1.8
with:
name: sqlagentjobdeploymenttool
path: C:\txnproc\transactionprocessing\sqlagentjobdeploymenttool
- name: Deploy SQL Agent Job
shell: powershell
env:
SQL_AGENT_JOB_CONNECTION_STRING: ${{ secrets.SQL_AGENT_JOB_CONNECTION_STRING }}
SQL_AGENT_JOB_DATABASE_NAME: ${{ secrets.SQL_AGENT_JOB_DATABASE_NAME }}
run: |
$toolRoot = 'C:\txnproc\transactionprocessing\sqlagentjobdeploymenttool'
New-Item -ItemType Directory -Path $toolRoot -Force | Out-Null
Expand-Archive -Path (Join-Path $toolRoot 'sqlagentjobdeploymenttool.zip') -DestinationPath $toolRoot -Force
$toolExe = Join-Path $toolRoot 'SqlServerAgentJobDeploymentTool.exe'
$stdoutPath = Join-Path $env:RUNNER_TEMP 'sql-agent-job-deployment.stdout.log'
$stderrPath = Join-Path $env:RUNNER_TEMP 'sql-agent-job-deployment.stderr.log'
function Quote-Argument {
param([string]$Value)
'"' + ($Value -replace '"', '\"') + '"'
}
Remove-Item -LiteralPath $stdoutPath, $stderrPath -ErrorAction SilentlyContinue
$arguments = @(
'--manifest', (Join-Path $toolRoot 'transactionprocessor-readmodel-transaction-jobs.json'),
'--connection-string', $env:SQL_AGENT_JOB_CONNECTION_STRING,
'--database-name', $env:SQL_AGENT_JOB_DATABASE_NAME
) | ForEach-Object { Quote-Argument $_ }
$process = Start-Process `
-FilePath $toolExe `
-ArgumentList ($arguments -join ' ') `
-Wait `
-PassThru `
-NoNewWindow `
-RedirectStandardOutput $stdoutPath `
-RedirectStandardError $stderrPath
$exitCode = $process.ExitCode
Write-Host "Captured SQL Agent job deployment exit code: $exitCode"
if ($null -eq $exitCode) {
throw "SQL Agent job deployment did not produce an exit code. Stdout: $stdoutPath. Stderr: $stderrPath."
}
if (Test-Path $stdoutPath) {
Get-Content -LiteralPath $stdoutPath
}
if (Test-Path $stderrPath) {
Get-Content -LiteralPath $stderrPath | ForEach-Object { Write-Error $_ }
}
Write-Host "SQL Agent job deployment exit code: $exitCode"
if ($exitCode -ne 0) {
throw "SQL Agent job deployment failed with exit code $exitCode. Stdout: $stdoutPath. Stderr: $stderrPath."
}
- name: Upload SQL Agent deployment logs on failure
if: failure()
uses: actions/upload-artifact@v4.4.0
with:
name: sql-agent-job-deployment-logs-staging
path: |
${{ runner.temp }}\sql-agent-job-deployment.stdout.log
${{ runner.temp }}\sql-agent-job-deployment.stderr.log
- name: Download the artifact (Merchant Pos)
uses: actions/download-artifact@v4.1.8
with:
name: merchantpos
- name: Remove existing Windows service (Merchant Pos)
run: |
$serviceName = "Transaction Processing - Merchant Pos"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Unzip the files (Merchant Pos)
run: |
Expand-Archive -Path merchantpos.zip -DestinationPath "C:\txnproc\transactionprocessing\merchantpos" -Force
- name: Install as a Windows service (Merchant Pos)
run: |
$serviceName = "Transaction Processing - Merchant Pos"
$servicePath = "C:\txnproc\transactionprocessing\merchantpos\TransactionProcessing.MerchantPos.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
- name: Download the artifact (Merchant File Processor)
uses: actions/download-artifact@v4.1.8
with:
name: merchantfileprocessor
- name: Remove existing Windows service (Merchant File Processor)
run: |
$serviceName = "Transaction Processing - Merchant File Processor"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Unzip the files (Merchant File Processor)
run: |
Expand-Archive -Path merchantfileprocessor.zip -DestinationPath "C:\txnproc\transactionprocessing\merchantfileprocessor" -Force
- name: Install as a Windows service (Merchant File Processor)
run: |
$serviceName = "Transaction Processing - Merchant File Processor"
$servicePath = "C:\txnproc\transactionprocessing\merchantfileprocessor\TransactionProcessing.MerchantFileProcessor.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
- name: Download the artifact (Health Monitoring)
uses: actions/download-artifact@v4.1.8
with:
name: healthmonitoring
- name: Remove existing Windows service (Health Monitoring)
run: |
$serviceName = "Transaction Processing - Health Monitoring"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Unzip the files (Health Monitoring)
run: |
Expand-Archive -Path healthmonitoring.zip -DestinationPath "C:\txnproc\transactionprocessing\healthmonitoring" -Force
- name: Install as a Windows service (Health Monitoring)
run: |
$serviceName = "Transaction Processing - Health Monitoring"
$servicePath = "C:\txnproc\transactionprocessing\healthmonitoring\HealthMonitoring.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
deployproduction:
runs-on: [productionserver, windows]
needs: [build, buildsqlagentjobdeploymenttool, deploystaging]
environment: production
name: "Deploy to Production"
steps:
- name: Download ScheduledTasks
uses: actions/download-artifact@v4.1.8
with:
name: scheduledtasks
path: ${{ runner.temp }}\scheduledtasks
- name: Install scheduled tasks
shell: powershell
env:
SCHEDULED_TASK_USER: ${{ secrets.SCHEDULED_TASK_USER }}
SCHEDULED_TASK_PASSWORD: ${{ secrets.SCHEDULED_TASK_PASSWORD }}
run: |
$taskScriptDir = 'C:\txnproc\transactionprocessing\powershell'
$scheduledTasksDownloadRoot = Join-Path $env:RUNNER_TEMP 'scheduledtasks'
$scheduledTasksRoot = Join-Path $scheduledTasksDownloadRoot 'ScheduledTasks'
if (-not (Test-Path $scheduledTasksRoot)) {
$scheduledTasksRoot = $scheduledTasksDownloadRoot
}
New-Item -ItemType Directory -Path $taskScriptDir -Force | Out-Null
Get-ChildItem -Path $scheduledTasksRoot -Recurse -Filter *.ps1 |
Where-Object { $_.FullName -notmatch '\\Tests\\' } |
Copy-Item -Destination $taskScriptDir -Force
Get-ChildItem -Path $scheduledTasksRoot -Recurse -Filter daily-support-check.json |
Where-Object { $_.FullName -notmatch '\\Reports\\|\\Tests\\' } |
Copy-Item -Destination $taskScriptDir -Force
$kurrentDbClientOutput = Get-ChildItem -Path $scheduledTasksRoot -Recurse -Directory -Filter publishOutput |
Where-Object { $_.FullName -match '\\DailySupportCheck\\KurrentDbClient\\publishOutput$' } |
Select-Object -First 1
if (-not $kurrentDbClientOutput) {
throw 'Packaged KurrentDB client output was not found in the scheduled-tasks artifact.'
}
$kurrentDbClientDestination = Join-Path $taskScriptDir 'KurrentDbClient'
New-Item -ItemType Directory -Path $kurrentDbClientDestination -Force | Out-Null
Copy-Item -Path (Join-Path $kurrentDbClientOutput.FullName '*') -Destination $kurrentDbClientDestination -Recurse -Force
Get-ChildItem -Path $scheduledTasksRoot -Recurse -Filter *.xml |
Where-Object { $_.FullName -notmatch '\\Tests\\' } |
ForEach-Object {
[xml]$taskDefinition = Get-Content -Path $_.FullName -Raw
$taskName = [string]$taskDefinition.Task.RegistrationInfo.URI
if ([string]::IsNullOrWhiteSpace($taskName)) {
$taskName = $_.BaseName
}
$taskName = $taskName.TrimStart('\')
& schtasks.exe /Create /TN $taskName /XML $_.FullName /RU SYSTEM /F
if ($LASTEXITCODE -ne 0) {
throw "Failed to register scheduled task [$taskName] from [$($_.FullName)]"
}
}
- name: Download SQL Agent Job Deployment Tool
uses: actions/download-artifact@v4.1.8
with:
name: sqlagentjobdeploymenttool
path: C:\txnproc\transactionprocessing\sqlagentjobdeploymenttool
- name: Deploy SQL Agent Job
shell: powershell
env:
SQL_AGENT_JOB_CONNECTION_STRING: ${{ secrets.SQL_AGENT_JOB_CONNECTION_STRING }}
SQL_AGENT_JOB_DATABASE_NAME: ${{ secrets.SQL_AGENT_JOB_DATABASE_NAME }}
run: |
$toolRoot = 'C:\txnproc\transactionprocessing\sqlagentjobdeploymenttool'
New-Item -ItemType Directory -Path $toolRoot -Force | Out-Null
Expand-Archive -Path (Join-Path $toolRoot 'sqlagentjobdeploymenttool.zip') -DestinationPath $toolRoot -Force
$toolExe = Join-Path $toolRoot 'SqlServerAgentJobDeploymentTool.exe'
$stdoutPath = Join-Path $env:RUNNER_TEMP 'sql-agent-job-deployment.stdout.log'
$stderrPath = Join-Path $env:RUNNER_TEMP 'sql-agent-job-deployment.stderr.log'
function Quote-Argument {
param([string]$Value)
'"' + ($Value -replace '"', '\"') + '"'
}
Remove-Item -LiteralPath $stdoutPath, $stderrPath -ErrorAction SilentlyContinue
$arguments = @(
'--manifest', (Join-Path $toolRoot 'transactionprocessor-readmodel-transaction-jobs.json'),
'--connection-string', $env:SQL_AGENT_JOB_CONNECTION_STRING,
'--database-name', $env:SQL_AGENT_JOB_DATABASE_NAME
) | ForEach-Object { Quote-Argument $_ }
$process = Start-Process `
-FilePath $toolExe `
-ArgumentList ($arguments -join ' ') `
-Wait `
-PassThru `
-NoNewWindow `
-RedirectStandardOutput $stdoutPath `
-RedirectStandardError $stderrPath
$exitCode = $process.ExitCode
Write-Host "Captured SQL Agent job deployment exit code: $exitCode"
if ($null -eq $exitCode) {
throw "SQL Agent job deployment did not produce an exit code. Stdout: $stdoutPath. Stderr: $stderrPath."
}
if (Test-Path $stdoutPath) {
Get-Content -LiteralPath $stdoutPath
}
if (Test-Path $stderrPath) {
Get-Content -LiteralPath $stderrPath | ForEach-Object { Write-Error $_ }
}
Write-Host "SQL Agent job deployment exit code: $exitCode"
if ($exitCode -ne 0) {
throw "SQL Agent job deployment failed with exit code $exitCode. Stdout: $stdoutPath. Stderr: $stderrPath."
}
- name: Upload SQL Agent deployment logs on failure
if: failure()
uses: actions/upload-artifact@v4.4.0
with:
name: sql-agent-job-deployment-logs-production
path: |
${{ runner.temp }}\sql-agent-job-deployment.stdout.log
${{ runner.temp }}\sql-agent-job-deployment.stderr.log
- name: Remove existing Windows service (Merchant Pos)
run: |
$serviceName = "Transaction Processing - Merchant Pos"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Unzip the files (Merchant Pos)
run: |
Expand-Archive -Path merchantpos.zip -DestinationPath "C:\txnproc\transactionprocessing\merchantpos" -Force
- name: Install as a Windows service (Merchant Pos)
run: |
$serviceName = "Transaction Processing - Merchant Pos"
$servicePath = "C:\txnproc\transactionprocessing\merchantpos\TransactionProcessor.MerchantPos.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
- name: Remove existing Windows service (Merchant File Processor)
run: |
$serviceName = "Transaction Processing - Merchant File Processor"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Download the artifact (Merchant File Processor)
uses: actions/download-artifact@v4.1.8
with:
name: merchantfileprocessor
- name: Unzip the files (Merchant File Processor)
run: |
Expand-Archive -Path merchantfileprocessor.zip -DestinationPath "C:\txnproc\transactionprocessing\merchantfileprocessor" -Force
- name: Install as a Windows service (Merchant File Processor)
run: |
$serviceName = "Transaction Processing - Merchant File Processor"
$servicePath = "C:\txnproc\transactionprocessing\merchantfileprocessor\TransactionProcessing.MerchantFileProcessor.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
- name: Download the artifact (Health Monitoring)
uses: actions/download-artifact@v4.1.8
with:
name: healthmonitoring
- name: Remove existing Windows service (Health Monitoring)
run: |
$serviceName = "Transaction Processing - Health Monitoring"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}
- name: Unzip the files (Health Monitoring)
run: |
Expand-Archive -Path healthmonitoring.zip -DestinationPath "C:\txnproc\transactionprocessing\healthmonitoring" -Force
- name: Install as a Windows service (Health Monitoring)
run: |
$serviceName = "Transaction Processing - Health Monitoring"
$servicePath = "C:\txnproc\transactionprocessing\healthmonitoring\HealthMonitoring.exe"
New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName