Skip to content

Commit

Permalink
chore: create examples crate
Browse files Browse the repository at this point in the history
  • Loading branch information
claymcleod committed Oct 2, 2024
1 parent cd990cb commit a2eecff
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 97 deletions.
28 changes: 18 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"crankshaft-config",
"crankshaft-docker",
"crankshaft-engine",
"examples",
]
resolver = "2"

Expand Down
12 changes: 0 additions & 12 deletions crankshaft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ rust-version.workspace = true
crankshaft-config = { path = "../crankshaft-config", version = "0.1.0" }
crankshaft-engine = { path = "../crankshaft-engine", version = "0.1.0" }

[dev-dependencies]
clap.workspace = true
color-eyre.workspace = true
eyre.workspace = true
serde_yaml.workspace = true
tempfile.workspace = true
tokio.workspace = true
toml.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
url.workspace = true

[features]
default = ["config", "engine"]
config = []
Expand Down
73 changes: 0 additions & 73 deletions crankshaft/examples/driver.rs

This file was deleted.

40 changes: 40 additions & 0 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "examples"
publish = false
version = "0.1.0"
license.workspace = true
edition.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[dependencies]
crankshaft = { path = "../crankshaft" }

clap.workspace = true
color-eyre.workspace = true
dirs.workspace = true
eyre.workspace = true
serde_yaml.workspace = true
tempfile.workspace = true
tokio.workspace = true
toml.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
url.workspace = true

[[bin]]
name = "docker"
path = "src/docker/main.rs"

[[bin]]
name = "lsf"
path = "src/lsf/main.rs"

[[bin]]
name = "tes"
path = "src/tes/main.rs"

[lints]
workspace = true
10 changes: 8 additions & 2 deletions crankshaft/examples/docker.rs → examples/src/docker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//!
//! `cargo run --release --example docker`
use std::env::current_dir;

use clap::Parser;
use crankshaft::Engine;
use crankshaft::config::backend::Kind;
Expand Down Expand Up @@ -45,11 +47,15 @@ async fn run(args: Args) -> Result<()> {
.context("initializing Docker backend")?;

let task = Task::builder()
.name("my-example-task")
.description("a longer description")
.extend_executions(vec![
Execution::builder()
.working_directory(".")
.working_directory(
current_dir()
.expect("a current working directory")
.display()
.to_string(),
)
.image("ubuntu")
.args(&[String::from("echo"), String::from("'hello, world!'")])
.try_build()
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a2eecff

Please sign in to comment.