This repository was archived by the owner on Sep 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathPackage.ps1
More file actions
78 lines (67 loc) · 3.23 KB
/
Package.ps1
File metadata and controls
78 lines (67 loc) · 3.23 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
$missionControlPath = $PSScriptRoot
$buildType = "Release"
$dotNetVersion = "net6.0"
$packagedFolder = Join-Path $PSScriptRoot "packaged"
if (-not (Test-Path $packagedFolder))
{
New-Item $packagedFolder -ItemType Directory | Out-Null
}
#Package HangarBay
$hangarBayDstPath = [IO.Path]::Combine($packagedFolder, "HangarBay", "bin")
if (-not (Test-Path $hangarBayDstPath))
{
New-Item $hangarBayDstPath -ItemType Directory | Out-Null
}
$hangarBaySrcPath = [IO.Path]::Combine($missionControlPath, "HangarBay", "bin", $buildType, $dotNetVersion)
$copyPath = Join-Path $hangarBaySrcPath "*"
Copy-Item -Path $copyPath -Destination $hangarBayDstPath -Exclude "appsettings.Development.json", "HangarBay.deps.json"
$toZipPath = Join-Path $hangarBayDstPath ".."
$zipPath = "HangarBay.zip"
Compress-Archive -Path $toZipPath -DestinationPath $zipPath -Force
#Package LaunchPad
$launchPadDstPath = [IO.Path]::Combine($packagedFolder, "LaunchPad", "bin")
if (-not (Test-Path $launchPadDstPath))
{
New-Item $launchPadDstPath -ItemType Directory | Out-Null
}
$launchPadSrcPath = [IO.Path]::Combine($missionControlPath, "LaunchPad", "bin", $buildType, $dotNetVersion)
$copyPath = Join-Path $launchPadSrcPath "*"
Copy-Item -Path $copyPath -Destination $launchPadDstPath -Exclude "appsettings.Development.json", "LaunchPad.deps.json"
$toZipPath = Join-Path $launchPadDstPath ".."
$zipPath = "LaunchPad.zip"
Compress-Archive -Path $toZipPath -DestinationPath $zipPath -Force
#Package MissionControl
$missionControlDstPath = [IO.Path]::Combine($packagedFolder, "MissionControl", "bin")
if (-not (Test-Path $missionControlDstPath))
{
New-Item $missionControlDstPath -ItemType Directory | Out-Null
}
$missionControlSrcPath = [IO.Path]::Combine($missionControlPath, "MissionControl", "bin", $buildType, $dotNetVersion)
$copyPath = Join-Path $missionControlSrcPath "*"
Copy-Item -Path $copyPath -Destination $missionControlDstPath -Exclude "appsettings.Development.json", "MissionControl.deps.json"
$dependenciesZipPath = Join-Path $missionControlDstPath ".."
Compress-Archive -Path (Join-Path $hangarBayDstPath "*") -DestinationPath (Join-Path $dependenciesZipPath "hangarBay.zip") -Force
Compress-Archive -Path (Join-Path $launchPadDstPath "*") -DestinationPath (Join-Path $dependenciesZipPath "launchPad.zip") -Force
$toZipPath = Join-Path $missionControlDstPath ".."
$zipPath = "MissionControl.zip"
if (Test-Path $zipPath)
{
Remove-Item $zipPath
}
Compress-Archive -Path $toZipPath -DestinationPath $zipPath
#Package UI
$uiDstPath = [IO.Path]::Combine($packagedFolder, "UI")
if (-not (Test-Path $uiDstPath))
{
New-Item $uiDstPath -ItemType Directory | Out-Null
}
$uiSrcPath = [IO.Path]::Combine($missionControlPath, "MissionControl.EngineeringUI", "Server", "bin", $buildType, $dotNetVersion, "publish")
$copyPath = Join-Path $uiSrcPath "*"
Copy-Item -Path $copyPath -Destination $uiDstPath -Exclude "appsettings.Development.json" -Recurse
Remove-Item -Path ([IO.Path]::Combine($uiDstPath, "wwwroot", "appsettings.json.br"))
Remove-Item -Path ([IO.Path]::Combine($uiDstPath, "wwwroot", "appsettings.json.gz"))
$toZipPath = $uiDstPath
$zipPath = "UI.zip"
Compress-Archive -Path $toZipPath -DestinationPath $zipPath -Force
# Cleanup temp directories
Remove-Item -Path $packagedFolder -Recurse