Add deploy and staging scripts

This commit is contained in:
august kline 2024-11-14 16:55:04 -05:00
parent b53ad99d72
commit a8fdecd74c
4 changed files with 25 additions and 2 deletions

3
Cargo.lock generated
View File

@ -294,10 +294,11 @@ dependencies = [
[[package]]
name = "blogdb"
version = "0.1.0"
source = "git+https://git.augustkline.com/august/blogdb#67c0c156cc42f32a35c1815c39762b841cab4ea7"
source = "git+https://git.augustkline.com/august/blogdb#136b42918f09a527653e4535fbee096a29e13309"
dependencies = [
"anyhow",
"argon2",
"dotenvy",
"infer",
"mime_guess",
"rand 0.8.5",

11
deploy.sh Executable file
View File

@ -0,0 +1,11 @@
#! /usr/bin/env bash
# this only works on macos for now, cross compilation toolchain from https://github.com/messense/homebrew-macos-cross-toolchains
cargo update;
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc cargo build --release --target x86_64-unknown-linux-gnu;
scp target/x86_64-unknown-linux-gnu/release/evie kline@augustkline.com:/home/kline/;
ssh kline@augustkline.com "mv ~/evie /var/www/evieippolito.com/; sudo systemctl restart evie"

View File

@ -115,7 +115,7 @@ impl BlogStateInner {
let username = env!("INIT_USER_NAME").to_string();
let password = env!("INIT_USER_PASSWORD").to_string();
let domain = env!("DOMAIN").to_string();
let db = BlogDb::new(&username, password.clone(), DB_URL).await?;
let db = BlogDb::new(&username, password.clone()).await?;
Self::add_initial_assets(&db).await?;
Self::add_initial_pages(&db).await?;
#[cfg(debug_assertions)]

11
stage.sh Executable file
View File

@ -0,0 +1,11 @@
#! /usr/bin/env bash
# this only works on macos for now, cross compilation toolchain from https://github.com/messense/homebrew-macos-cross-toolchains
cargo update;
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc cargo build --release --target x86_64-unknown-linux-gnu;
scp target/x86_64-unknown-linux-gnu/release/evie kline@augustkline.com:/home/kline/;
ssh kline@augustkline.com "mv ~/evie /var/www/staging.evieippolito.com/; sudo systemctl restart evie-staging"