X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=deploy.ps1;h=b03e439c45546fb0127deda019491b5b5dd03d8a;hb=7042b184ef30ec8ce26aa31df10523bd2b82dfaf;hp=5edd2a41bdf6a6a6aebbe38816139c036d67974d;hpb=6cc0700aa5b90500b620ca8dd5b2976892aee0a7;p=rup.git diff --git a/deploy.ps1 b/deploy.ps1 index 5edd2a4..b03e439 100755 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -1,14 +1,30 @@ +if ($args.Count -lt 1) { + $scriptName = [Environment]::GetCommandLineArgs()[1] + Write-Output "Usage: $scriptName " + exit 1 +} + git pull cargo build --release +systemctl --user stop www-rouleunpet.service + $destination=$args[0] if (!(Test-Path -Path $destination)) { New-Item -ItemType directory -Path $destination } +strip target/release/rup # To reduce the executable size. Copy-Item target/release/rup -Destination $destination Copy-Item key.secret -Destination $destination -Copy-Item conf.ron -Destination $destination + Copy-Item static -Destination $destination -Recurse -Force +# Do not overwrite the configuration. +if (!(Test-Path -Path $destination/conf.ron)) { + Copy-Item conf.ron -Destination $destination +} + +systemctl --user start www-rouleunpet.service +