mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-18 21:13:28 +02:00
Compare commits
3 Commits
dagger-sdk
...
dagger-sdk
Author | SHA1 | Date | |
---|---|---|---|
6a9a560cdc
|
|||
e578b0e371 | |||
3e8ca8d86e |
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -260,7 +260,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-core"
|
name = "dagger-core"
|
||||||
version = "0.2.6"
|
version = "0.2.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"dirs",
|
"dirs",
|
||||||
@@ -309,7 +309,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-sdk"
|
name = "dagger-sdk"
|
||||||
version = "0.2.14"
|
version = "0.2.15"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"dagger-core",
|
"dagger-core",
|
||||||
|
@@ -20,7 +20,7 @@ members = [
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.5" }
|
dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.5" }
|
||||||
dagger-core = { path = "crates/dagger-core", version = "^0.2.3" }
|
dagger-core = { path = "crates/dagger-core", version = "^0.2.7" }
|
||||||
|
|
||||||
clap = "4.1.6"
|
clap = "4.1.6"
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
|
@@ -8,6 +8,6 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "4.1.6"
|
clap = "4.1.6"
|
||||||
color-eyre = "0.6.2"
|
color-eyre = "0.6.2"
|
||||||
dagger-sdk = { path = "../crates/dagger-sdk/", version = "^0.2.14" }
|
dagger-sdk = { path = "../crates/dagger-sdk/", version = "^0.2.15" }
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
tokio = { version = "1.25.0", features = ["full"] }
|
tokio = { version = "1.25.0", features = ["full"] }
|
||||||
|
@@ -11,7 +11,7 @@ publish = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
convert_case = "0.6.0"
|
convert_case = "0.6.0"
|
||||||
dagger-core = { path = "../dagger-core", version = "^0.2.6" }
|
dagger-core = { path = "../dagger-core", version = "^0.2.7" }
|
||||||
|
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
genco = "0.17.3"
|
genco = "0.17.3"
|
||||||
|
@@ -26,9 +26,10 @@ fn render_enum_values(values: &FullType) -> Option<rust::Tokens> {
|
|||||||
|
|
||||||
pub fn render_enum(t: &FullType) -> eyre::Result<rust::Tokens> {
|
pub fn render_enum(t: &FullType) -> eyre::Result<rust::Tokens> {
|
||||||
let serialize = rust::import("serde", "Serialize");
|
let serialize = rust::import("serde", "Serialize");
|
||||||
|
let deserialize = rust::import("serde", "Deserialize");
|
||||||
|
|
||||||
Ok(quote! {
|
Ok(quote! {
|
||||||
#[derive($serialize, Clone, PartialEq, Debug)]
|
#[derive($serialize, $deserialize, Clone, PartialEq, Debug)]
|
||||||
pub enum $(t.name.as_ref()) {
|
pub enum $(t.name.as_ref()) {
|
||||||
$(render_enum_values(t))
|
$(render_enum_values(t))
|
||||||
}
|
}
|
||||||
|
@@ -5,8 +5,35 @@ 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.7 (2023-02-24)
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- <csr-id-3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f/> update to dagger-v0.3.13
|
||||||
|
|
||||||
|
### Commit Statistics
|
||||||
|
|
||||||
|
<csr-read-only-do-not-edit/>
|
||||||
|
|
||||||
|
- 1 commit contributed to the release.
|
||||||
|
- 4 days passed between releases.
|
||||||
|
- 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**
|
||||||
|
- update to dagger-v0.3.13 ([`3e8ca8d`](https://github.com/kjuulh/dagger-rs/commit/3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f))
|
||||||
|
</details>
|
||||||
|
|
||||||
## v0.2.6 (2023-02-20)
|
## v0.2.6 (2023-02-20)
|
||||||
|
|
||||||
|
<csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/>
|
||||||
|
|
||||||
### Chore
|
### Chore
|
||||||
|
|
||||||
- <csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/> ran clippy
|
- <csr-id-1f77d90c0f0ac832a181b2322350ea395612986c/> ran clippy
|
||||||
@@ -19,7 +46,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/>
|
||||||
|
|
||||||
- 2 commits contributed to the release.
|
- 3 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
|
||||||
|
|
||||||
@@ -30,6 +57,7 @@ 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-core v0.2.6, dagger-codegen v0.2.7, dagger-sdk v0.2.12 ([`7179f8b`](https://github.com/kjuulh/dagger-rs/commit/7179f8b598ef04e62925e39d3f55740253c01686))
|
||||||
- ran clippy ([`1f77d90`](https://github.com/kjuulh/dagger-rs/commit/1f77d90c0f0ac832a181b2322350ea395612986c))
|
- ran clippy ([`1f77d90`](https://github.com/kjuulh/dagger-rs/commit/1f77d90c0f0ac832a181b2322350ea395612986c))
|
||||||
- cli session keep session alive ([`8dfecf9`](https://github.com/kjuulh/dagger-rs/commit/8dfecf976c5537cc2c03881de2b2fd2b2508683a))
|
- cli session keep session alive ([`8dfecf9`](https://github.com/kjuulh/dagger-rs/commit/8dfecf976c5537cc2c03881de2b2fd2b2508683a))
|
||||||
</details>
|
</details>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dagger-core"
|
name = "dagger-core"
|
||||||
version = "0.2.6"
|
version = "0.2.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license-file = "LICENSE.MIT"
|
license-file = "LICENSE.MIT"
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
use std::{
|
use std::{fs::canonicalize, path::PathBuf, process::Stdio, sync::Arc};
|
||||||
fs::canonicalize,
|
|
||||||
path::PathBuf,
|
|
||||||
process::Stdio,
|
|
||||||
sync::Arc,
|
|
||||||
};
|
|
||||||
|
|
||||||
use tokio::io::AsyncBufReadExt;
|
use tokio::io::AsyncBufReadExt;
|
||||||
|
|
||||||
@@ -105,7 +100,9 @@ impl InnerCliSession {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let conn = receiver.recv().await.ok_or(eyre::anyhow!("could not receive ok signal from dagger-engine"))?;
|
let conn = receiver.recv().await.ok_or(eyre::anyhow!(
|
||||||
|
"could not receive ok signal from dagger-engine"
|
||||||
|
))?;
|
||||||
|
|
||||||
Ok((conn, proc))
|
Ok((conn, proc))
|
||||||
}
|
}
|
||||||
|
@@ -129,7 +129,8 @@ impl Downloader {
|
|||||||
|
|
||||||
if !cli_bin_path.exists() {
|
if !cli_bin_path.exists() {
|
||||||
cli_bin_path = self
|
cli_bin_path = self
|
||||||
.download(cli_bin_path).await
|
.download(cli_bin_path)
|
||||||
|
.await
|
||||||
.context("failed to download CLI from archive")?;
|
.context("failed to download CLI from archive")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +239,11 @@ mod test {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn download() {
|
async fn download() {
|
||||||
let cli_path = Downloader::new("0.3.10".into()).unwrap().get_cli().await.unwrap();
|
let cli_path = Downloader::new("0.3.10".into())
|
||||||
|
.unwrap()
|
||||||
|
.get_cli()
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Some("dagger-0.3.10"),
|
Some("dagger-0.3.10"),
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
cli_session::CliSession, config::Config, connect_params::ConnectParams, downloader::Downloader,
|
cli_session::CliSession, config::Config, connect_params::ConnectParams, downloader::Downloader,
|
||||||
};
|
};
|
||||||
@@ -12,14 +10,17 @@ impl Engine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
async fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||||
let cli = Downloader::new("0.3.12".into())?.get_cli().await?;
|
let cli = Downloader::new("0.3.13".into())?.get_cli().await?;
|
||||||
|
|
||||||
let cli_session = CliSession::new();
|
let cli_session = CliSession::new();
|
||||||
|
|
||||||
Ok(cli_session.connect(cfg, &cli).await?)
|
Ok(cli_session.connect(cfg, &cli).await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn start(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
pub async fn start(
|
||||||
|
&self,
|
||||||
|
cfg: &Config,
|
||||||
|
) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||||
// TODO: Add from existing session as well
|
// TODO: Add from existing session as well
|
||||||
self.from_cli(cfg).await
|
self.from_cli(cfg).await
|
||||||
}
|
}
|
||||||
@@ -35,7 +36,10 @@ mod tests {
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn engine_can_start() {
|
async fn engine_can_start() {
|
||||||
let engine = Engine::new();
|
let engine = Engine::new();
|
||||||
let params = engine.start(&Config::new(None, None, None, None)).await.unwrap();
|
let params = engine
|
||||||
|
.start(&Config::new(None, None, None, None))
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
assert_ne!(
|
assert_ne!(
|
||||||
params.0,
|
params.0,
|
||||||
|
@@ -6,8 +6,40 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
and this project adheres to
|
and this project adheres to
|
||||||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## v0.2.15 (2023-02-24)
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- <csr-id-3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f/> update to dagger-v0.3.13
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- <csr-id-e578b0e371e13bc30ada793b7cd6ebe75ba83a07/> set deserialize on enums as well
|
||||||
|
|
||||||
|
### Commit Statistics
|
||||||
|
|
||||||
|
<csr-read-only-do-not-edit/>
|
||||||
|
|
||||||
|
- 2 commits contributed to the release.
|
||||||
|
- 2 days passed between releases.
|
||||||
|
- 2 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**
|
||||||
|
- set deserialize on enums as well ([`e578b0e`](https://github.com/kjuulh/dagger-rs/commit/e578b0e371e13bc30ada793b7cd6ebe75ba83a07))
|
||||||
|
- update to dagger-v0.3.13 ([`3e8ca8d`](https://github.com/kjuulh/dagger-rs/commit/3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f))
|
||||||
|
</details>
|
||||||
|
|
||||||
## v0.2.14 (2023-02-22)
|
## v0.2.14 (2023-02-22)
|
||||||
|
|
||||||
|
<csr-id-e331ca003546f4ebe00f33b65c3b45c6b0586514/>
|
||||||
|
|
||||||
### Chore
|
### Chore
|
||||||
|
|
||||||
- <csr-id-e331ca003546f4ebe00f33b65c3b45c6b0586514/> fix whitespace
|
- <csr-id-e331ca003546f4ebe00f33b65c3b45c6b0586514/> fix whitespace
|
||||||
@@ -16,7 +48,7 @@ and this project adheres to
|
|||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
<csr-read-only-do-not-edit/>
|
||||||
|
|
||||||
- 1 commit contributed to the release.
|
- 2 commits contributed to the release.
|
||||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
- 1 commit was 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
|
||||||
|
|
||||||
@@ -27,6 +59,7 @@ and this project adheres to
|
|||||||
<details><summary>view details</summary>
|
<details><summary>view details</summary>
|
||||||
|
|
||||||
* **Uncategorized**
|
* **Uncategorized**
|
||||||
|
- Release dagger-sdk v0.2.14 ([`88b055c`](https://github.com/kjuulh/dagger-rs/commit/88b055cb47d3d474e2c37d8fa8259df5faad9da5))
|
||||||
- fix whitespace ([`e331ca0`](https://github.com/kjuulh/dagger-rs/commit/e331ca003546f4ebe00f33b65c3b45c6b0586514))
|
- fix whitespace ([`e331ca0`](https://github.com/kjuulh/dagger-rs/commit/e331ca003546f4ebe00f33b65c3b45c6b0586514))
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dagger-sdk"
|
name = "dagger-sdk"
|
||||||
version = "0.2.14"
|
version = "0.2.15"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license-file = "LICENSE.MIT"
|
license-file = "LICENSE.MIT"
|
||||||
@@ -11,7 +11,7 @@ publish = true
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dagger-core = { path = "../dagger-core", version = "^0.2.6" }
|
dagger-core = { path = "../dagger-core", version = "^0.2.7" }
|
||||||
|
|
||||||
base64 = "0.21.0"
|
base64 = "0.21.0"
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
|
@@ -35,7 +35,8 @@ async fn main() -> eyre::Result<()> {
|
|||||||
.container()
|
.container()
|
||||||
.from("nginx")
|
.from("nginx")
|
||||||
.with_directory("/usr/share/nginx/html", build_dir.id().await?)
|
.with_directory("/usr/share/nginx/html", build_dir.id().await?)
|
||||||
.publish(format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>())).await?;
|
.publish(format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()))
|
||||||
|
.await?;
|
||||||
|
|
||||||
println!("published image to: {}", ref_);
|
println!("published image to: {}", ref_);
|
||||||
|
|
||||||
|
@@ -13,7 +13,8 @@ async fn main() -> eyre::Result<()> {
|
|||||||
let ref_ = client
|
let ref_ = client
|
||||||
.container()
|
.container()
|
||||||
.build(context_dir.id().await?)
|
.build(context_dir.id().await?)
|
||||||
.publish(format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>())).await?;
|
.publish(format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()))
|
||||||
|
.await?;
|
||||||
|
|
||||||
println!("published image to: {}", ref_);
|
println!("published image to: {}", ref_);
|
||||||
|
|
||||||
|
@@ -6,7 +6,8 @@ async fn main() -> eyre::Result<()> {
|
|||||||
.container()
|
.container()
|
||||||
.from("golang:1.19")
|
.from("golang:1.19")
|
||||||
.with_exec(vec!["go", "version"])
|
.with_exec(vec!["go", "version"])
|
||||||
.stdout().await?;
|
.stdout()
|
||||||
|
.await?;
|
||||||
|
|
||||||
println!("Hello from Dagger and {}", version.trim());
|
println!("Hello from Dagger and {}", version.trim());
|
||||||
|
|
||||||
|
@@ -39,7 +39,8 @@ async fn main() -> eyre::Result<()> {
|
|||||||
"/usr/share/nginx/html",
|
"/usr/share/nginx/html",
|
||||||
client.host().directory(output).id().await?,
|
client.host().directory(output).id().await?,
|
||||||
)
|
)
|
||||||
.publish(format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>())).await?;
|
.publish(format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()))
|
||||||
|
.await?;
|
||||||
|
|
||||||
println!("published image to: {}", ref_);
|
println!("published image to: {}", ref_);
|
||||||
|
|
||||||
|
@@ -23,7 +23,8 @@ async fn main() -> eyre::Result<()> {
|
|||||||
|
|
||||||
let out = runner
|
let out = runner
|
||||||
.with_exec(vec!["npm", "test", "--", "--watchAll=false"])
|
.with_exec(vec!["npm", "test", "--", "--watchAll=false"])
|
||||||
.stderr().await?;
|
.stderr()
|
||||||
|
.await?;
|
||||||
|
|
||||||
println!("{}", out);
|
println!("{}", out);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user