recipes/deploy.ps1
2019-08-11 22:05:35 +02:00

29 lines
672 B
PowerShell

if ($args.Count -lt 1) {
$scriptName = [Environment]::GetCommandLineArgs()[1]
echo "Usage: $scriptName <destination>"
exit 1
}
systemctl --user stop www-recipes.service
git pull
cargo build --release
$destination=$args[0]
if (!(Test-Path -Path $destination)) {
New-Item -ItemType directory -Path $destination
}
Copy-Item target/release/rup -Destination $destination
Copy-Item key.secret -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-recipes.service