From f882f56c9c1c285d7e5f26b2c3711f20a923e0eb Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 28 Jan 2024 22:24:28 +0100 Subject: [PATCH] feat: add time str Signed-off-by: kjuulh --- Cargo.lock | 71 +++++++++++++++++++++++++ crates/cuddle-ci/Cargo.toml | 1 + crates/cuddle-ci/src/cuddle_releaser.rs | 3 ++ 3 files changed, 75 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index c7f74a8..1434279 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,21 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" version = "0.6.5" @@ -174,6 +189,20 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.0", +] + [[package]] name = "ci" version = "0.1.0" @@ -325,6 +354,7 @@ name = "cuddle-ci" version = "0.2.0" dependencies = [ "async-trait", + "chrono", "clap", "dagger-cuddle-please", "dagger-rust", @@ -916,6 +946,29 @@ dependencies = [ "tokio-rustls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1066,6 +1119,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + [[package]] name = "num_cpus" version = "1.16.0" @@ -1960,6 +2022,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/crates/cuddle-ci/Cargo.toml b/crates/cuddle-ci/Cargo.toml index 2416cae..5ac5a7d 100644 --- a/crates/cuddle-ci/Cargo.toml +++ b/crates/cuddle-ci/Cargo.toml @@ -23,6 +23,7 @@ serde_json.workspace = true serde_yaml.workspace = true serde.workspace = true tracing = {version = "0.1.40", features = ["log"]} +chrono = {version = "0.4.33"} [dev-dependencies] tokio.workspace = true diff --git a/crates/cuddle-ci/src/cuddle_releaser.rs b/crates/cuddle-ci/src/cuddle_releaser.rs index fa43024..160ec1a 100644 --- a/crates/cuddle-ci/src/cuddle_releaser.rs +++ b/crates/cuddle-ci/src/cuddle_releaser.rs @@ -92,7 +92,10 @@ impl MainAction for CuddleReleaser { client.host().unix_socket(ssh_sock.clone()), ); + let time = chrono::Local::now(); + cuddle_releaser + .with_exec(vec!["echo", &time.to_rfc3339()]) .with_exec(vec![ "cuddle-releaser", "release",