Onboarding / Deployment Scripts / Marketing updates
This commit is contained in:
+24
-1
@@ -145,6 +145,24 @@ function Export-HomepageContent {
|
||||
}
|
||||
}
|
||||
|
||||
function New-UnixScriptCopy {
|
||||
param(
|
||||
[string]$SourcePath
|
||||
)
|
||||
|
||||
if (-not (Test-Path -LiteralPath $SourcePath)) {
|
||||
throw "Script not found: $SourcePath"
|
||||
}
|
||||
|
||||
$tempFileName = 'goodwalk-deploy-helper-{0}.sh' -f ([System.Guid]::NewGuid().ToString('N'))
|
||||
$tempPath = Join-Path ([System.IO.Path]::GetTempPath()) $tempFileName
|
||||
$content = [System.IO.File]::ReadAllText($SourcePath)
|
||||
$normalized = $content.Replace("`r`n", "`n").Replace("`r", "`n")
|
||||
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||
[System.IO.File]::WriteAllText($tempPath, $normalized, $utf8NoBom)
|
||||
return $tempPath
|
||||
}
|
||||
|
||||
function Invoke-SiteCheck {
|
||||
param([string]$Url)
|
||||
|
||||
@@ -242,6 +260,7 @@ if (-not $Force) {
|
||||
}
|
||||
|
||||
$archivePath = $null
|
||||
$uploadHelperPath = $null
|
||||
|
||||
try {
|
||||
Write-Host ''
|
||||
@@ -255,7 +274,8 @@ try {
|
||||
|
||||
Write-Host ''
|
||||
Write-Host '[deploy] Uploading remote helper'
|
||||
Invoke-External -FilePath 'scp' -Arguments ($sshArgs + @($LocalRemoteHelperPath, $scpHelperTarget))
|
||||
$uploadHelperPath = New-UnixScriptCopy -SourcePath $LocalRemoteHelperPath
|
||||
Invoke-External -FilePath 'scp' -Arguments ($sshArgs + @($uploadHelperPath, $scpHelperTarget))
|
||||
|
||||
Write-Host ''
|
||||
Write-Host '[deploy] Uploading application archive'
|
||||
@@ -310,4 +330,7 @@ finally {
|
||||
if ($archivePath -and (Test-Path -LiteralPath $archivePath)) {
|
||||
Remove-Item -LiteralPath $archivePath -Force
|
||||
}
|
||||
if ($uploadHelperPath -and (Test-Path -LiteralPath $uploadHelperPath)) {
|
||||
Remove-Item -LiteralPath $uploadHelperPath -Force
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user