From 9879ececa44536e2967c717122ee387cc71cffdc Mon Sep 17 00:00:00 2001 From: Reimar Date: Tue, 13 Aug 2024 19:06:43 +0200 Subject: [PATCH] Implement releasing rust backend --- API/release.sh | 10 ---------- release.sh | 19 +++++++++++++++++++ rust-backend/.cargo/config.toml | 3 +++ rust-backend/Cargo.lock | 1 + rust-backend/Cargo.toml | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) delete mode 100755 API/release.sh create mode 100755 release.sh create mode 100644 rust-backend/.cargo/config.toml diff --git a/API/release.sh b/API/release.sh deleted file mode 100755 index 0ff7d45..0000000 --- a/API/release.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -dotnet publish -r linux-arm64 -p:PublishSingleFile=true --self-contained false -dotnet ef migrations bundle --self-contained -r linux-arm64 --force - -rsync -va bin/Release/net8.0/linux-arm64/publish/* reimar@reim.ar:/home/reimar/skantravels -rsync -va efbundle reimar@reim.ar:/home/reimar/skantravels - -ssh -t reimar@reim.ar "systemctl restart skantravels" - diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..72ab281 --- /dev/null +++ b/release.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +cd API +dotnet publish -r linux-arm64 -p:PublishSingleFile=true --self-contained false +dotnet ef migrations bundle -r linux-arm64 --force + +cd ../rust-backend +cargo build --release --target=aarch64-unknown-linux-gnu + +cd .. +rsync -va \ + rust-backend/target/aarch64-unknown-linux-gnu/release/skantravels \ + API/efbundle \ + API/bin/Release/net8.0/linux-arm64/publish/API \ + API/bin/Release/net8.0/linux-arm64/publish/libe_sqlite3.so \ + reimar@reim.ar:/home/reimar/skantravels + +ssh -t reimar@reim.ar "systemctl restart skantravels && systemctl restart skantravels-rust" + diff --git a/rust-backend/.cargo/config.toml b/rust-backend/.cargo/config.toml new file mode 100644 index 0000000..6b80765 --- /dev/null +++ b/rust-backend/.cargo/config.toml @@ -0,0 +1,3 @@ +[target.aarch64-unknown-linux-gnu] +linker = "aarch64-linux-gnu-gcc" + diff --git a/rust-backend/Cargo.lock b/rust-backend/Cargo.lock index 10784bd..fa14a42 100644 --- a/rust-backend/Cargo.lock +++ b/rust-backend/Cargo.lock @@ -665,6 +665,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" dependencies = [ + "cc", "pkg-config", "vcpkg", ] diff --git a/rust-backend/Cargo.toml b/rust-backend/Cargo.toml index 788fb66..3b01a45 100644 --- a/rust-backend/Cargo.toml +++ b/rust-backend/Cargo.toml @@ -6,5 +6,5 @@ edition = "2021" [dependencies] actix-web = "4" refinery = { version = "0.8.14", features = ["rusqlite"] } -rusqlite = "0.31" +rusqlite = { version = "0.31", features = ["bundled"] }