Update email in conf
[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 Copy-Item target/release/recipes -Destination $destination
19
20 Copy-Item backend/static -Destination $destination -Recurse -Force
21
22 # Do not overwrite the configuration.
23 if (!(Test-Path -Path $destination/conf.ron)) {
24    Copy-Item conf.ron -Destination $destination
25 }
26
27 systemctl --user start www-recipes.service
28