diff --git a/backend/server/Cargo.toml b/backend/server/Cargo.toml new file mode 100644 index 0000000..481e539 --- /dev/null +++ b/backend/server/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "server" +version = "0.1.0" +edition = "2021" + +[dependencies] +macros = { path = "../macros" } + + +tracing = "0.1.41" +git2 = "0.20.0" + +[build-dependencies] +git2 = "0.20.0" +chrono = "0.4.39" \ No newline at end of file diff --git a/backend/server/build.rs b/backend/server/build.rs new file mode 100644 index 0000000..b7d91af --- /dev/null +++ b/backend/server/build.rs @@ -0,0 +1,15 @@ +use chrono::Utc; +use git2::Repository; + +fn main() { + let repo = Repository::open("../..").expect("failed to open repository"); + let commit = repo + .head() + .expect("failed to get HEAD") + .peel_to_commit() + .expect("failed to get HEAD commit"); + let hash = commit.id().to_string(); + let utc_date = Utc::now().date_naive().format("%Y%m%d").to_string(); + let build_id = format!("{}@{}", utc_date, &hash[..8]); + println!("cargo:rustc-env=BUILD_ID={}", build_id); +} diff --git a/loadbalancer/Cargo.toml b/loadbalancer/Cargo.toml new file mode 100644 index 0000000..bf98b23 --- /dev/null +++ b/loadbalancer/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loadbalancer" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/loadbalancer/src/main.rs b/loadbalancer/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/loadbalancer/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}