fixes to the deployment procedure
This commit is contained in:
parent
384e64009e
commit
c9859124c3
7
Justfile
7
Justfile
|
@ -1,5 +1,10 @@
|
||||||
|
port := "8080"
|
||||||
|
|
||||||
serve wasm_profile="wasm-dev": (wasm wasm_profile)
|
serve wasm_profile="wasm-dev": (wasm wasm_profile)
|
||||||
cargo run -p rkgk
|
RKGK_PORT={{port}} cargo run -p rkgk
|
||||||
|
|
||||||
wasm profile="wasm-dev":
|
wasm profile="wasm-dev":
|
||||||
cargo build -p haku-wasm --target wasm32-unknown-unknown --profile {{profile}}
|
cargo build -p haku-wasm --target wasm32-unknown-unknown --profile {{profile}}
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
bash admin/deploy.bash
|
||||||
|
|
|
@ -12,7 +12,7 @@ mkfifo $reload_fifo
|
||||||
reload() {
|
reload() {
|
||||||
# This just kind of assumes recompilation doesn't take too long.
|
# This just kind of assumes recompilation doesn't take too long.
|
||||||
kill "$rkgk_pid"
|
kill "$rkgk_pid"
|
||||||
cargo run --release -- serve --port 8083 > "$build_log" 2>&1 &
|
just port=8083 serve wasm-release > "$build_log" 2>&1 &
|
||||||
rkgk_pid="$!"
|
rkgk_pid="$!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use std::{
|
use std::{
|
||||||
fs::{copy, create_dir_all, remove_dir_all},
|
fs::{copy, create_dir_all, remove_dir_all},
|
||||||
|
net::Ipv4Addr,
|
||||||
path::Path,
|
path::Path,
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
@ -102,10 +103,15 @@ async fn fallible_main() -> eyre::Result<()> {
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
let app = app.nest("/dev/live-reload", live_reload::router());
|
let app = app.nest("/dev/live-reload", live_reload::router());
|
||||||
|
|
||||||
let listener = TcpListener::bind("0.0.0.0:8080")
|
let port: u16 = std::env::var("RKGK_PORT")
|
||||||
|
.unwrap_or("8080".into())
|
||||||
|
.parse()
|
||||||
|
.context("failed to parse RKGK_PORT")?;
|
||||||
|
|
||||||
|
let listener = TcpListener::bind((Ipv4Addr::from([0u8, 0, 0, 0]), port))
|
||||||
.await
|
.await
|
||||||
.expect("cannot bind to port");
|
.expect("cannot bind to port");
|
||||||
info!("listening on port 8080");
|
info!("listening on port {port}");
|
||||||
axum::serve(listener, app).await.expect("cannot serve app");
|
axum::serve(listener, app).await.expect("cannot serve app");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue