Replace powershell script by nushell script
[recipes.git] / deploy.ps1
diff --git a/deploy.ps1 b/deploy.ps1
deleted file mode 100644 (file)
index 9a47e6b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# TODO:
-# * copy the conf if it doesn't exist
-# * create the destination directory if doesn't exist
-
-if ($args.Count -lt 3) {
-   $scriptName = [Environment]::GetCommandLineArgs()[1]
-   Write-Output "Usage: $scriptName <address: string> <remote director: string> <key file: openssh format>"
-   exit 1
-}
-
-$address=$args[0]
-$destination=$args[1]
-$ssh_key=$args[2]
-
-$ssh_command = "ssh -i $ssh_key $address"
-$scp_command = "scp -r -i $ssh_key"
-
-function Invoke-SSH([string]$command)
-{
-   $expression = "$ssh_command $command"
-   Write-Output "Executing: $expression"
-   Invoke-Expression $expression | Write-Output
-}
-
-function Copy-SSH([string]$source, [string]$destination)
-{
-   $expression = "$scp_command $source ${address}:$destination"
-   Write-Output "Executing: $expression"
-   Invoke-Expression $expression
-}
-
-cargo build --target arm-unknown-linux-gnueabihf --release
-
-Invoke-SSH "sudo systemctl stop recipes"
-
-Copy-SSH -source "./target/arm-unknown-linux-gnueabihf/release/recipes" -destination "~/recipes/"
-
-Invoke-SSH "rm -rf recipes/static"
-Copy-SSH -source "./backend/static/" -destination "~/recipes/"
-
-Copy-SSH -source "./backend/sql/" -destination "~/recipes/"
-
-Invoke-SSH "chmod u+x recipes/recipes"
-Invoke-SSH "sudo systemctl start recipes"
-
-Write-Output "Deployment finished"