Update dependencies
[recipes.git] / deploy.ps1
1 if ($args.Count -lt 1) {
2    $scriptName = [Environment]::GetCommandLineArgs()[1]
3    echo "Usage: $scriptName <destination>"
4    exit 1
5 }
6
7 git pull
8 cargo build --release
9
10 systemctl --user stop www-recipes.service
11
12 $destination=$args[0]
13
14 if (!(Test-Path -Path $destination)) {
15    New-Item -ItemType directory -Path $destination
16 }
17
18 strip target/release/recipes
19 Copy-Item target/release/recipes -Destination $destination
20
21 Copy-Item backend/static -Destination $destination -Recurse -Force
22
23 # Do not overwrite the configuration.
24 if (!(Test-Path -Path $destination/conf.ron)) {
25    Copy-Item backend/conf.ron -Destination $destination
26 }
27
28 systemctl --user start www-recipes.service
29