From: www-data Date: Sun, 25 Aug 2019 20:52:19 +0000 (+0200) Subject: Move the deploy script. X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=d64d0bceb81b8f15fa0af625b96edf75ab7cdcff;p=recipes.git Move the deploy script. --- diff --git a/backend/deploy.ps1 b/backend/deploy.ps1 deleted file mode 100644 index e066f1d..0000000 --- a/backend/deploy.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -if ($args.Count -lt 1) { - $scriptName = [Environment]::GetCommandLineArgs()[1] - echo "Usage: $scriptName " - 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 -} - -Copy-Item target/release/recipes -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 - diff --git a/deploy.ps1 b/deploy.ps1 new file mode 100644 index 0000000..527f532 --- /dev/null +++ b/deploy.ps1 @@ -0,0 +1,29 @@ +if ($args.Count -lt 1) { + $scriptName = [Environment]::GetCommandLineArgs()[1] + echo "Usage: $scriptName " + 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 +