Responsiveness tweaks
This commit is contained in:
+7
-19
@@ -1,13 +1,17 @@
|
||||
<#
|
||||
Deploy embycovers to an Asustor NAS over SSH/SCP from Windows PowerShell.
|
||||
|
||||
Syncs project files to the NAS, then runs `docker compose build` and
|
||||
`docker compose up -d` on the remote. All runtime configuration (Emby URL,
|
||||
API key, ports, volumes) comes from docker-compose.yml — edit it there.
|
||||
|
||||
Prerequisites on your Windows machine:
|
||||
- OpenSSH Client installed. Test with: ssh -V
|
||||
- SSH enabled on the Asustor NAS.
|
||||
- Docker / Docker Compose available on the Asustor NAS.
|
||||
|
||||
Example:
|
||||
.\deploy.ps1 -NasHost MATT-NAS -NasUser admin -EmbyUrl http://192.168.1.50:8096 -EmbyApiKey abcdef123456
|
||||
.\deploy.ps1 -NasHost MATT-NAS -NasUser ssh
|
||||
#>
|
||||
|
||||
param(
|
||||
@@ -17,15 +21,7 @@ param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$NasUser,
|
||||
|
||||
[string]$RemoteAppDir = "/share/Docker/embycovers",
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$EmbyUrl,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$EmbyApiKey,
|
||||
|
||||
[int]$HostPort = 8500
|
||||
[string]$RemoteAppDir = "/share/Docker/embycovers"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -43,8 +39,6 @@ $LocalDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$Remote = "$NasUser@$NasHost"
|
||||
|
||||
Write-Host "Deploying embycovers to ${Remote}:$RemoteAppDir"
|
||||
Write-Host "Emby URL: $EmbyUrl"
|
||||
Write-Host "Host port: $HostPort"
|
||||
|
||||
ssh $Remote @"
|
||||
set -e
|
||||
@@ -72,16 +66,11 @@ if ($LogoFiles) {
|
||||
Invoke-Expression $ScpCmd
|
||||
}
|
||||
|
||||
# Patch docker-compose.yml on the NAS with the supplied Emby settings, then build & run.
|
||||
# Build and run on the NAS using values from docker-compose.yml.
|
||||
$RemoteCommands = @"
|
||||
set -e
|
||||
cd '$RemoteAppDir'
|
||||
|
||||
# Patch compose env vars and host port from deployment parameters.
|
||||
sed -i "s#EMBY_URL=.*#EMBY_URL=$EmbyUrl#g" docker-compose.yml
|
||||
sed -i "s#EMBY_API_KEY=.*#EMBY_API_KEY=$EmbyApiKey#g" docker-compose.yml
|
||||
sed -i "s#\"8500:8500\"#\"$HostPort:8500\"#g" docker-compose.yml
|
||||
|
||||
if command -v docker-compose >/dev/null 2>&1; then
|
||||
docker-compose build
|
||||
docker-compose up -d
|
||||
@@ -94,6 +83,5 @@ fi
|
||||
ssh $Remote $RemoteCommands
|
||||
|
||||
Write-Host "Deployment complete."
|
||||
Write-Host "App should be reachable at: http://${NasHost}:$HostPort"
|
||||
Write-Host "To view logs:"
|
||||
Write-Host " ssh $Remote 'cd $RemoteAppDir && docker compose logs -f'"
|
||||
|
||||
Reference in New Issue
Block a user