recipes/deploy.ps1
2019-08-25 22:52:19 +02:00

29 lines
674 B
PowerShell

if ($args.Count -lt 1) {
$scriptName = [Environment]::GetCommandLineArgs()[1]
echo "Usage: $scriptName <destination>"
exit 1
}
git pull
cargo build --release
systemctl --user stop www-recipes.service
$destination=$args[0]
if (!(Test-Path -Path $destination)) {
New-Item -ItemType directory -Path $destination
}
strip target/release/recipes
Copy-Item target/release/recipes -Destination $destination
Copy-Item backend/static -Destination $destination -Recurse -Force
# Do not overwrite the configuration.
if (!(Test-Path -Path $destination/conf.ron)) {
Copy-Item backend/conf.ron -Destination $destination
}
systemctl --user start www-recipes.service