mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-12-29 11:11:02 +01:00
Compare commits
6 Commits
c35c104b49
...
feat/fix-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
a6d4b9e062
|
|||
|
e5bfbe7218
|
|||
|
57ecf97d23
|
|||
|
6779808322
|
|||
|
b25b350d90
|
|||
|
c14cd64453
|
41
Cargo.lock
generated
41
Cargo.lock
generated
@@ -114,7 +114,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"color-eyre",
|
"color-eyre",
|
||||||
"dagger-sdk 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"dagger-sdk 0.2.2",
|
||||||
"eyre",
|
"eyre",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-codegen"
|
name = "dagger-codegen"
|
||||||
version = "0.2.4"
|
version = "0.2.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"convert_case",
|
"convert_case",
|
||||||
"dagger-core 0.2.2",
|
"dagger-core 0.2.2",
|
||||||
@@ -330,7 +330,25 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-sdk"
|
name = "dagger-sdk"
|
||||||
version = "0.2.6"
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d1562df6d7d47fbb891331896ec9c04da1db129c1a9f073c40c33ab918f06e99"
|
||||||
|
dependencies = [
|
||||||
|
"base64",
|
||||||
|
"dagger-core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"eyre",
|
||||||
|
"futures",
|
||||||
|
"genco",
|
||||||
|
"gql_client",
|
||||||
|
"pretty_assertions",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dagger-sdk"
|
||||||
|
version = "0.2.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"dagger-core 0.2.2",
|
"dagger-core 0.2.2",
|
||||||
@@ -346,23 +364,6 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dagger-sdk"
|
|
||||||
version = "0.2.6"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "654625e954f59d70eb897bb681936c3e8b69c5f6e528f85c0b307554883db63f"
|
|
||||||
dependencies = [
|
|
||||||
"base64",
|
|
||||||
"dagger-core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"derive_builder",
|
|
||||||
"eyre",
|
|
||||||
"futures",
|
|
||||||
"gql_client",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"tokio",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "darling"
|
name = "darling"
|
||||||
version = "0.14.3"
|
version = "0.14.3"
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "4.1.6"
|
clap = "4.1.6"
|
||||||
color-eyre = "0.6.2"
|
color-eyre = "0.6.2"
|
||||||
dagger-sdk = "0.2.6"
|
dagger-sdk = "0.2.2"
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
|
|||||||
246
ci/src/main.rs
246
ci/src/main.rs
@@ -1,6 +1,6 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use dagger_sdk::{Container, HostDirectoryOpts, Query};
|
use dagger_sdk::gen::{Container, HostDirectoryOpts, Query};
|
||||||
|
|
||||||
fn main() -> eyre::Result<()> {
|
fn main() -> eyre::Result<()> {
|
||||||
color_eyre::install().unwrap();
|
color_eyre::install().unwrap();
|
||||||
@@ -11,11 +11,11 @@ fn main() -> eyre::Result<()> {
|
|||||||
.subcommand(clap::Command::new("release"))
|
.subcommand(clap::Command::new("release"))
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
let client = dagger_sdk::connect()?;
|
let client = dagger_sdk::client::connect()?;
|
||||||
|
|
||||||
match matches.subcommand() {
|
match matches.subcommand() {
|
||||||
Some(("pr", _)) => {
|
Some(("pr", _)) => {
|
||||||
let base = select_base_image(client.clone())?;
|
let base = select_base_image(client.clone());
|
||||||
return validate_pr(client, base);
|
return validate_pr(client, base);
|
||||||
}
|
}
|
||||||
Some(("release", subm)) => return release(client, subm),
|
Some(("release", subm)) => return release(client, subm),
|
||||||
@@ -29,31 +29,41 @@ fn main() -> eyre::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn release(client: Arc<Query>, _subm: &clap::ArgMatches) -> Result<(), color_eyre::Report> {
|
fn release(client: Arc<Query>, _subm: &clap::ArgMatches) -> Result<(), color_eyre::Report> {
|
||||||
let src_dir = client.host().directory_opts(
|
let src_dir = client.host().directory(
|
||||||
".",
|
".".into(),
|
||||||
HostDirectoryOpts {
|
Some(HostDirectoryOpts {
|
||||||
exclude: Some(vec!["target/"]),
|
exclude: Some(vec!["target/".into()]),
|
||||||
include: None,
|
include: None,
|
||||||
},
|
}),
|
||||||
);
|
);
|
||||||
let base_image = client
|
let base_image = client
|
||||||
.container()
|
.container(None)
|
||||||
.from("rust:latest")
|
.from("rust:latest".into())
|
||||||
.with_workdir("app")
|
.with_workdir("app".into())
|
||||||
.with_mounted_directory("/app/", src_dir.id()?);
|
.with_mounted_directory("/app/".into(), src_dir.id());
|
||||||
|
|
||||||
let container = base_image
|
let container = base_image
|
||||||
.with_exec(vec!["cargo", "install", "cargo-smart-release"])
|
.with_exec(
|
||||||
.with_exec(vec![
|
vec![
|
||||||
"cargo",
|
"cargo".into(),
|
||||||
"smart-release",
|
"install".into(),
|
||||||
"--execute",
|
"cargo-smart-release".into(),
|
||||||
"--allow-fully-generated-changelogs",
|
],
|
||||||
"--no-changelog-preview",
|
None,
|
||||||
"dagger-rs",
|
)
|
||||||
"dagger-sdk",
|
.with_exec(
|
||||||
]);
|
vec![
|
||||||
let exit = container.exit_code()?;
|
"cargo".into(),
|
||||||
|
"smart-release".into(),
|
||||||
|
"--execute".into(),
|
||||||
|
"--allow-fully-generated-changelogs".into(),
|
||||||
|
"--no-changelog-preview".into(),
|
||||||
|
"dagger-rs".into(),
|
||||||
|
"dagger-sdk".into(),
|
||||||
|
],
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
let exit = container.exit_code();
|
||||||
if exit != 0 {
|
if exit != 0 {
|
||||||
eyre::bail!("container failed with non-zero exit code");
|
eyre::bail!("container failed with non-zero exit code");
|
||||||
}
|
}
|
||||||
@@ -63,111 +73,153 @@ fn release(client: Arc<Query>, _subm: &clap::ArgMatches) -> Result<(), color_eyr
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_dependencies(client: Arc<Query>) -> eyre::Result<Container> {
|
fn get_dependencies(client: Arc<Query>) -> Container {
|
||||||
let cargo_dir = client.host().directory_opts(
|
let cargo_dir = client.host().directory(
|
||||||
".",
|
".".into(),
|
||||||
HostDirectoryOpts {
|
Some(HostDirectoryOpts {
|
||||||
exclude: None,
|
exclude: None,
|
||||||
include: Some(vec![
|
include: Some(vec![
|
||||||
"**/Cargo.lock",
|
"**/Cargo.lock".into(),
|
||||||
"**/Cargo.toml",
|
"**/Cargo.toml".into(),
|
||||||
"**/main.rs",
|
"**/main.rs".into(),
|
||||||
"**/lib.rs",
|
"**/lib.rs".into(),
|
||||||
]),
|
]),
|
||||||
},
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
let src_dir = client.host().directory_opts(
|
let src_dir = client.host().directory(
|
||||||
".",
|
".".into(),
|
||||||
HostDirectoryOpts {
|
Some(HostDirectoryOpts {
|
||||||
exclude: Some(vec!["target/"]),
|
exclude: Some(vec!["target/".into()]),
|
||||||
include: None,
|
include: None,
|
||||||
},
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
let cache_cargo_index_dir = client.cache_volume("cargo_index");
|
let cache_cargo_index_dir = client.cache_volume("cargo_index".into());
|
||||||
let cache_cargo_deps = client.cache_volume("cargo_deps");
|
let cache_cargo_deps = client.cache_volume("cargo_deps".into());
|
||||||
let cache_cargo_bin = client.cache_volume("cargo_bin_cache");
|
let cache_cargo_bin = client.cache_volume("cargo_bin_cache".into());
|
||||||
|
|
||||||
let minio_url = "https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz";
|
let minio_url = "https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz".into();
|
||||||
|
|
||||||
let base_image = client
|
let base_image = client
|
||||||
.container()
|
.container(None)
|
||||||
.from("rust:latest")
|
.from("rust:latest".into())
|
||||||
.with_workdir("app")
|
.with_workdir("app".into())
|
||||||
.with_exec(vec!["apt-get", "update"])
|
.with_exec(vec!["apt-get".into(), "update".into()], None)
|
||||||
.with_exec(vec!["apt-get", "install", "--yes", "libpq-dev", "wget"])
|
.with_exec(
|
||||||
.with_exec(vec!["wget", minio_url])
|
vec![
|
||||||
.with_exec(vec![
|
"apt-get".into(),
|
||||||
"tar",
|
"install".into(),
|
||||||
"xzf",
|
"--yes".into(),
|
||||||
"sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz",
|
"libpq-dev".into(),
|
||||||
])
|
"wget".into(),
|
||||||
.with_exec(vec![
|
],
|
||||||
"mv",
|
None,
|
||||||
"sccache-v0.3.3-x86_64-unknown-linux-musl/sccache",
|
)
|
||||||
"/usr/local/bin/sccache",
|
.with_exec(vec!["wget".into(), minio_url], None)
|
||||||
])
|
.with_exec(
|
||||||
.with_exec(vec!["chmod", "+x", "/usr/local/bin/sccache"])
|
vec![
|
||||||
.with_env_variable("RUSTC_WRAPPER", "/usr/local/bin/sccache")
|
"tar".into(),
|
||||||
|
"xzf".into(),
|
||||||
|
"sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz".into(),
|
||||||
|
],
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.with_exec(
|
||||||
|
vec![
|
||||||
|
"mv".into(),
|
||||||
|
"sccache-v0.3.3-x86_64-unknown-linux-musl/sccache".into(),
|
||||||
|
"/usr/local/bin/sccache".into(),
|
||||||
|
],
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.with_exec(
|
||||||
|
vec!["chmod".into(), "+x".into(), "/usr/local/bin/sccache".into()],
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.with_env_variable("RUSTC_WRAPPER".into(), "/usr/local/bin/sccache".into())
|
||||||
.with_env_variable(
|
.with_env_variable(
|
||||||
"AWS_ACCESS_KEY_ID",
|
"AWS_ACCESS_KEY_ID".into(),
|
||||||
std::env::var("AWS_ACCESS_KEY_ID").unwrap_or("".into()),
|
std::env::var("AWS_ACCESS_KEY_ID").unwrap_or("".into()),
|
||||||
)
|
)
|
||||||
.with_env_variable(
|
.with_env_variable(
|
||||||
"AWS_SECRET_ACCESS_KEY",
|
"AWS_SECRET_ACCESS_KEY".into(),
|
||||||
std::env::var("AWS_SECRET_ACCESS_KEY").unwrap_or("".into()),
|
std::env::var("AWS_SECRET_ACCESS_KEY").unwrap_or("".into()),
|
||||||
)
|
)
|
||||||
.with_env_variable("SCCACHE_BUCKET", "sccache")
|
.with_env_variable("SCCACHE_BUCKET".into(), "sccache".into())
|
||||||
.with_env_variable("SCCACHE_REGION", "auto")
|
.with_env_variable("SCCACHE_REGION".into(), "auto".into())
|
||||||
.with_env_variable("SCCACHE_ENDPOINT", "https://api-minio.front.kjuulh.io")
|
.with_env_variable(
|
||||||
.with_mounted_cache("~/.cargo/bin", cache_cargo_bin.id()?)
|
"SCCACHE_ENDPOINT".into(),
|
||||||
.with_mounted_cache("~/.cargo/registry/index", cache_cargo_bin.id()?)
|
"https://api-minio.front.kjuulh.io".into(),
|
||||||
.with_mounted_cache("~/.cargo/registry/cache", cache_cargo_bin.id()?)
|
)
|
||||||
.with_mounted_cache("~/.cargo/git/db", cache_cargo_bin.id()?)
|
.with_mounted_cache("~/.cargo/bin".into(), cache_cargo_bin.id(), None)
|
||||||
.with_mounted_cache("target/", cache_cargo_bin.id()?)
|
.with_mounted_cache("~/.cargo/registry/index".into(), cache_cargo_bin.id(), None)
|
||||||
.with_exec(vec!["cargo", "install", "cargo-chef"]);
|
.with_mounted_cache("~/.cargo/registry/cache".into(), cache_cargo_bin.id(), None)
|
||||||
|
.with_mounted_cache("~/.cargo/git/db".into(), cache_cargo_bin.id(), None)
|
||||||
|
.with_mounted_cache("target/".into(), cache_cargo_bin.id(), None)
|
||||||
|
.with_exec(
|
||||||
|
vec!["cargo".into(), "install".into(), "cargo-chef".into()],
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
|
||||||
let recipe = base_image
|
let recipe = base_image
|
||||||
.with_mounted_directory(".", cargo_dir.id()?)
|
.with_mounted_directory(".".into(), cargo_dir.id())
|
||||||
.with_mounted_cache("~/.cargo/.package-cache", cache_cargo_index_dir.id()?)
|
.with_mounted_cache(
|
||||||
.with_exec(vec![
|
"~/.cargo/.package-cache".into(),
|
||||||
"cargo",
|
cache_cargo_index_dir.id(),
|
||||||
"chef",
|
None,
|
||||||
"prepare",
|
)
|
||||||
"--recipe-path",
|
.with_exec(
|
||||||
"recipe.json",
|
vec![
|
||||||
])
|
"cargo".into(),
|
||||||
.file("/app/recipe.json");
|
"chef".into(),
|
||||||
|
"prepare".into(),
|
||||||
|
"--recipe-path".into(),
|
||||||
|
"recipe.json".into(),
|
||||||
|
],
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.file("/app/recipe.json".into());
|
||||||
|
|
||||||
let builder_start = base_image
|
let builder_start = base_image
|
||||||
.with_mounted_file("/app/recipe.json", recipe.id()?)
|
.with_mounted_file("/app/recipe.json".into(), recipe.id())
|
||||||
.with_exec(vec![
|
.with_exec(
|
||||||
"cargo",
|
vec![
|
||||||
"chef",
|
"cargo".into(),
|
||||||
"cook",
|
"chef".into(),
|
||||||
"--release",
|
"cook".into(),
|
||||||
"--workspace",
|
"--release".into(),
|
||||||
"--recipe-path",
|
"--workspace".into(),
|
||||||
"recipe.json",
|
"--recipe-path".into(),
|
||||||
])
|
"recipe.json".into(),
|
||||||
.with_mounted_cache("/app/", cache_cargo_deps.id()?)
|
],
|
||||||
.with_mounted_directory("/app/", src_dir.id()?)
|
None,
|
||||||
.with_exec(vec!["cargo", "build", "--all", "--release"]);
|
)
|
||||||
|
.with_mounted_cache("/app/".into(), cache_cargo_deps.id(), None)
|
||||||
|
.with_mounted_directory("/app/".into(), src_dir.id())
|
||||||
|
.with_exec(
|
||||||
|
vec![
|
||||||
|
"cargo".into(),
|
||||||
|
"build".into(),
|
||||||
|
"--all".into(),
|
||||||
|
"--release".into(),
|
||||||
|
],
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
|
||||||
return Ok(builder_start);
|
return builder_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn select_base_image(client: Arc<Query>) -> eyre::Result<Container> {
|
fn select_base_image(client: Arc<Query>) -> Container {
|
||||||
let src_dir = get_dependencies(client.clone());
|
let src_dir = get_dependencies(client.clone());
|
||||||
|
|
||||||
src_dir
|
src_dir
|
||||||
}
|
}
|
||||||
|
|
||||||
fn validate_pr(_client: Arc<Query>, container: Container) -> eyre::Result<()> {
|
fn validate_pr(_client: Arc<Query>, container: Container) -> eyre::Result<()> {
|
||||||
//let container = container.with_exec(vec!["cargo", "test", "--all"], None);
|
//let container = container.with_exec(vec!["cargo".into(), "test".into(), "--all".into()], None);
|
||||||
|
|
||||||
let exit = container.exit_code()?;
|
let exit = container.exit_code();
|
||||||
if exit != 0 {
|
if exit != 0 {
|
||||||
eyre::bail!("container failed with non-zero exit code");
|
eyre::bail!("container failed with non-zero exit code");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,70 +5,6 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## v0.2.4 (2023-02-19)
|
|
||||||
|
|
||||||
### New Features
|
|
||||||
|
|
||||||
- <csr-id-f29ff836cfd72d5e051ca6a71a230ba1e9933091/> without Some in _opts functions
|
|
||||||
Option has been removed as a wrapper around opts. This makes it much
|
|
||||||
more convenient to use
|
|
||||||
|
|
||||||
```rust
|
|
||||||
client.container_opts(Some(ContainerOpts{}))
|
|
||||||
// ->
|
|
||||||
client.container_opts(ContainerOpts{})
|
|
||||||
```
|
|
||||||
|
|
||||||
The same options are still available, either an empty object can be
|
|
||||||
passed, or a non _opts function can be used
|
|
||||||
- <csr-id-9762da895a164e30c5dc60e89a83e934ceae47ab/> with _opts methods
|
|
||||||
Now all opt values enter into a _opts function instead of the original.
|
|
||||||
This avoids a lot of verbosity for both None in the case opts are
|
|
||||||
unwanted, and Some() if they actually are.
|
|
||||||
|
|
||||||
They are used like so:
|
|
||||||
|
|
||||||
```rust
|
|
||||||
client.container().from("...");
|
|
||||||
client.container_opts(Some(ContainerOpts{ ... }))
|
|
||||||
```
|
|
||||||
|
|
||||||
Some from opts will be removed in a future commit/pr
|
|
||||||
- <csr-id-94336d06378f035464e233b921dc3858070f582d/> move to &str instead of String and introduce builder.
|
|
||||||
This will make the api much easier to use, as we can now rely on ""
|
|
||||||
instead of "".into() for normal string values.
|
|
||||||
|
|
||||||
Introduced builder as well, which makes it much easier to use *Opts, as
|
|
||||||
it can handle the building of that, and get the benefits from String ->
|
|
||||||
&str, as that is currently not allowed for optional values
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- <csr-id-c627595fd2695e236924175d137c42f1480ccd6b/> cargo clippy
|
|
||||||
- <csr-id-02006d40fc2c0383e0412c15c36db9af7eda991f/> without phantom data
|
|
||||||
|
|
||||||
### Commit Statistics
|
|
||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
|
||||||
|
|
||||||
- 5 commits contributed to the release.
|
|
||||||
- 5 commits were understood as [conventional](https://www.conventionalcommits.org).
|
|
||||||
- 0 issues like '(#ID)' were seen in commit messages
|
|
||||||
|
|
||||||
### Commit Details
|
|
||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
|
||||||
|
|
||||||
<details><summary>view details</summary>
|
|
||||||
|
|
||||||
* **Uncategorized**
|
|
||||||
- cargo clippy ([`c627595`](https://github.com/kjuulh/dagger-rs/commit/c627595fd2695e236924175d137c42f1480ccd6b))
|
|
||||||
- without Some in _opts functions ([`f29ff83`](https://github.com/kjuulh/dagger-rs/commit/f29ff836cfd72d5e051ca6a71a230ba1e9933091))
|
|
||||||
- with _opts methods ([`9762da8`](https://github.com/kjuulh/dagger-rs/commit/9762da895a164e30c5dc60e89a83e934ceae47ab))
|
|
||||||
- without phantom data ([`02006d4`](https://github.com/kjuulh/dagger-rs/commit/02006d40fc2c0383e0412c15c36db9af7eda991f))
|
|
||||||
- move to &str instead of String and introduce builder. ([`94336d0`](https://github.com/kjuulh/dagger-rs/commit/94336d06378f035464e233b921dc3858070f582d))
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## v0.2.3 (2023-02-19)
|
## v0.2.3 (2023-02-19)
|
||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
@@ -80,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
<csr-read-only-do-not-edit/>
|
||||||
|
|
||||||
- 3 commits contributed to the release.
|
- 2 commits contributed to the release.
|
||||||
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
|
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
|
||||||
- 0 issues like '(#ID)' were seen in commit messages
|
- 0 issues like '(#ID)' were seen in commit messages
|
||||||
|
|
||||||
@@ -91,7 +27,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
<details><summary>view details</summary>
|
<details><summary>view details</summary>
|
||||||
|
|
||||||
* **Uncategorized**
|
* **Uncategorized**
|
||||||
- Release dagger-sdk v0.2.3, dagger-codegen v0.2.3, dagger-rs v0.2.9 ([`9235030`](https://github.com/kjuulh/dagger-rs/commit/92350306b3f0da40b4fc6dcaffcd90b891e83f70))
|
|
||||||
- with return result instead of unwrap ([`de063ea`](https://github.com/kjuulh/dagger-rs/commit/de063eae858eb3335d2558a57ee6a88689635200))
|
- with return result instead of unwrap ([`de063ea`](https://github.com/kjuulh/dagger-rs/commit/de063eae858eb3335d2558a57ee6a88689635200))
|
||||||
- remove unnecessary option returns ([`5d66736`](https://github.com/kjuulh/dagger-rs/commit/5d667369900a47d3a6015cd3814c240bc5c54436))
|
- remove unnecessary option returns ([`5d66736`](https://github.com/kjuulh/dagger-rs/commit/5d667369900a47d3a6015cd3814c240bc5c54436))
|
||||||
</details>
|
</details>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dagger-codegen"
|
name = "dagger-codegen"
|
||||||
version = "0.2.4"
|
version = "0.2.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license-file = "LICENSE.MIT"
|
license-file = "LICENSE.MIT"
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## v0.2.6 (2023-02-19)
|
## v0.2.4 (2023-02-19)
|
||||||
|
|
||||||
### Documentation
|
### Bug Fixes
|
||||||
|
|
||||||
- <csr-id-04e70ce964b343e28b3dbd0c46d10ccda958ab8c/> fix readme
|
- <csr-id-7d04ab1240e497e7804fed23a378d28c78f50a0a/> readme dagger-rs -> dagger-sdk
|
||||||
|
|
||||||
### Commit Statistics
|
### Commit Statistics
|
||||||
|
|
||||||
@@ -26,98 +26,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
<details><summary>view details</summary>
|
<details><summary>view details</summary>
|
||||||
|
|
||||||
* **Uncategorized**
|
* **Uncategorized**
|
||||||
- fix readme ([`04e70ce`](https://github.com/kjuulh/dagger-rs/commit/04e70ce964b343e28b3dbd0c46d10ccda958ab8c))
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## v0.2.5 (2023-02-19)
|
|
||||||
|
|
||||||
### New Features
|
|
||||||
|
|
||||||
- <csr-id-f29ff836cfd72d5e051ca6a71a230ba1e9933091/> without Some in _opts functions
|
|
||||||
Option has been removed as a wrapper around opts. This makes it much
|
|
||||||
more convenient to use
|
|
||||||
|
|
||||||
```rust
|
|
||||||
client.container_opts(Some(ContainerOpts{}))
|
|
||||||
// ->
|
|
||||||
client.container_opts(ContainerOpts{})
|
|
||||||
```
|
|
||||||
|
|
||||||
The same options are still available, either an empty object can be
|
|
||||||
passed, or a non _opts function can be used
|
|
||||||
- <csr-id-9762da895a164e30c5dc60e89a83e934ceae47ab/> with _opts methods
|
|
||||||
Now all opt values enter into a _opts function instead of the original.
|
|
||||||
This avoids a lot of verbosity for both None in the case opts are
|
|
||||||
unwanted, and Some() if they actually are.
|
|
||||||
|
|
||||||
They are used like so:
|
|
||||||
|
|
||||||
```rust
|
|
||||||
client.container().from("...");
|
|
||||||
client.container_opts(Some(ContainerOpts{ ... }))
|
|
||||||
```
|
|
||||||
|
|
||||||
Some from opts will be removed in a future commit/pr
|
|
||||||
- <csr-id-94336d06378f035464e233b921dc3858070f582d/> move to &str instead of String and introduce builder.
|
|
||||||
This will make the api much easier to use, as we can now rely on ""
|
|
||||||
instead of "".into() for normal string values.
|
|
||||||
|
|
||||||
Introduced builder as well, which makes it much easier to use *Opts, as
|
|
||||||
it can handle the building of that, and get the benefits from String ->
|
|
||||||
&str, as that is currently not allowed for optional values
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- <csr-id-c627595fd2695e236924175d137c42f1480ccd6b/> cargo clippy
|
|
||||||
- <csr-id-02006d40fc2c0383e0412c15c36db9af7eda991f/> without phantom data
|
|
||||||
- <csr-id-6e2292cf11942fbd26a52fe4e0fc8471e6eb70a3/> dependencies
|
|
||||||
|
|
||||||
### Commit Statistics
|
|
||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
|
||||||
|
|
||||||
- 7 commits contributed to the release.
|
|
||||||
- 6 commits were understood as [conventional](https://www.conventionalcommits.org).
|
|
||||||
- 0 issues like '(#ID)' were seen in commit messages
|
|
||||||
|
|
||||||
### Commit Details
|
|
||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
|
||||||
|
|
||||||
<details><summary>view details</summary>
|
|
||||||
|
|
||||||
* **Uncategorized**
|
|
||||||
- Release dagger-sdk v0.2.5, dagger-codegen v0.2.4 ([`f727318`](https://github.com/kjuulh/dagger-rs/commit/f72731807d8358fdb3d80432136b7a08bb7b1773))
|
|
||||||
- cargo clippy ([`c627595`](https://github.com/kjuulh/dagger-rs/commit/c627595fd2695e236924175d137c42f1480ccd6b))
|
|
||||||
- without Some in _opts functions ([`f29ff83`](https://github.com/kjuulh/dagger-rs/commit/f29ff836cfd72d5e051ca6a71a230ba1e9933091))
|
|
||||||
- with _opts methods ([`9762da8`](https://github.com/kjuulh/dagger-rs/commit/9762da895a164e30c5dc60e89a83e934ceae47ab))
|
|
||||||
- without phantom data ([`02006d4`](https://github.com/kjuulh/dagger-rs/commit/02006d40fc2c0383e0412c15c36db9af7eda991f))
|
|
||||||
- move to &str instead of String and introduce builder. ([`94336d0`](https://github.com/kjuulh/dagger-rs/commit/94336d06378f035464e233b921dc3858070f582d))
|
|
||||||
- dependencies ([`6e2292c`](https://github.com/kjuulh/dagger-rs/commit/6e2292cf11942fbd26a52fe4e0fc8471e6eb70a3))
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## v0.2.4 (2023-02-19)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- <csr-id-7d04ab1240e497e7804fed23a378d28c78f50a0a/> readme dagger-rs -> dagger-sdk
|
|
||||||
|
|
||||||
### Commit Statistics
|
|
||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
|
||||||
|
|
||||||
- 2 commits contributed to the release.
|
|
||||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
|
||||||
- 0 issues like '(#ID)' were seen in commit messages
|
|
||||||
|
|
||||||
### Commit Details
|
|
||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
|
||||||
|
|
||||||
<details><summary>view details</summary>
|
|
||||||
|
|
||||||
* **Uncategorized**
|
|
||||||
- Release dagger-sdk v0.2.4 ([`cc81124`](https://github.com/kjuulh/dagger-rs/commit/cc81124f899f44f80c1ee7d1e23a7e02d8cc4b7c))
|
|
||||||
- readme dagger-rs -> dagger-sdk ([`7d04ab1`](https://github.com/kjuulh/dagger-rs/commit/7d04ab1240e497e7804fed23a378d28c78f50a0a))
|
- readme dagger-rs -> dagger-sdk ([`7d04ab1`](https://github.com/kjuulh/dagger-rs/commit/7d04ab1240e497e7804fed23a378d28c78f50a0a))
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dagger-sdk"
|
name = "dagger-sdk"
|
||||||
version = "0.2.6"
|
version = "0.2.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license-file = "LICENSE.MIT"
|
license-file = "LICENSE.MIT"
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ fn main() -> eyre::Result<()> {
|
|||||||
let client = dagger_sdk::connect()?;
|
let client = dagger_sdk::connect()?;
|
||||||
|
|
||||||
let version = client
|
let version = client
|
||||||
.container()
|
.container(None)
|
||||||
.from("golang:1.19")
|
.from("golang:1.19".into())
|
||||||
.with_exec(vec!["go", "version"])
|
.with_exec(vec!["go".into(), "version".into()], None)
|
||||||
.stdout()?;
|
.stdout()?;
|
||||||
|
|
||||||
println!("Hello from Dagger and {}", version.trim());
|
println!("Hello from Dagger and {}", version.trim());
|
||||||
|
|||||||
Reference in New Issue
Block a user