kopia lustrzana https://github.com/piku/piku
commit
efd4e8e59f
|
@ -0,0 +1 @@
|
|||
/target
|
|
@ -0,0 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "piku-rust"
|
||||
version = "0.1.0"
|
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "piku-rust"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
|
@ -0,0 +1,3 @@
|
|||
PIKU_AUTO_RESTART=1
|
||||
PORT=4000
|
||||
BIND_ADDRESS=127.0.0.1
|
|
@ -0,0 +1 @@
|
|||
web: cargo run
|
|
@ -0,0 +1,2 @@
|
|||
[toolchain]
|
||||
channel = "1.78.0"
|
|
@ -0,0 +1,17 @@
|
|||
use std::{io::Write, net::TcpListener};
|
||||
|
||||
fn main() -> std::io::Result<()> {
|
||||
let addr = format!("{}:{}",
|
||||
std::env::var("BIND_ADDRESS").expect("no addr"),
|
||||
std::env::var("PORT").expect("no port"));
|
||||
|
||||
println!("Listening on {}", addr);
|
||||
let listener = TcpListener::bind(addr)?;
|
||||
|
||||
for stream in listener.incoming() {
|
||||
let mut stream = stream?;
|
||||
stream.write_all(b"Hello!\n")?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
11
piku.py
11
piku.py
|
@ -409,6 +409,8 @@ def do_deploy(app, deltas={}, newrev=None):
|
|||
settings.update(deploy_clojure_cli(app, deltas))
|
||||
elif exists(join(app_path, 'project.clj')) and found_app("Clojure Lein") and check_requirements(['java', 'lein']):
|
||||
settings.update(deploy_clojure_leiningen(app, deltas))
|
||||
elif exists(join(app_path, 'Cargo.toml')) and exists(join(app_path, 'rust-toolchain.toml')) and found_app("Rust") and check_requirements(['rustc', 'cargo']):
|
||||
settings.update(deploy_rust(app, deltas))
|
||||
elif 'release' in workers and 'web' in workers:
|
||||
echo("-----> Generic app detected.", fg='green')
|
||||
settings.update(deploy_identity(app, deltas))
|
||||
|
@ -588,6 +590,15 @@ def deploy_go(app, deltas={}):
|
|||
return spawn_app(app, deltas)
|
||||
|
||||
|
||||
def deploy_rust(app, deltas={}):
|
||||
"""Deploy a Rust application"""
|
||||
|
||||
app_path = join(APP_ROOT, app)
|
||||
echo("-----> Running cargo build for '{}'".format(app), fg='green')
|
||||
call('cargo build', cwd=app_path, shell=True)
|
||||
return spawn_app(app, deltas)
|
||||
|
||||
|
||||
def deploy_node(app, deltas={}):
|
||||
"""Deploy a Node application"""
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue