Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 6, 2024
1 parent 73336d4 commit 281edce
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/.fluentci/plugin/Cargo.lock

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

2 changes: 1 addition & 1 deletion example/.fluentci/plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "snyk"
version = "0.6.0"
version = "0.6.1"

[lib]
crate-type = ["cdylib"]
Expand Down
90 changes: 90 additions & 0 deletions example/.fluentci/plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,96 @@ pub fn test(args: String) -> FnResult<String> {
Ok(stdout)
}

#[plugin_fn]
pub fn iac(args: String) -> FnResult<String> {
let stdout = dag()
.pipeline("iac test")?
.pkgx()?
.with_exec(vec![
"pkgx",
"+nodejs.org",
"+bun.sh",
"bunx",
"snyk",
"iac",
&args,
])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn code(args: String) -> FnResult<String> {
let stdout = dag()
.pipeline("iac test")?
.pkgx()?
.with_exec(vec![
"pkgx",
"+nodejs.org",
"+bun.sh",
"bunx",
"snyk",
"code",
&args,
])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn sbom(args: String) -> FnResult<String> {
let stdout = dag()
.pipeline("iac test")?
.pkgx()?
.with_exec(vec![
"pkgx",
"+nodejs.org",
"+bun.sh",
"bunx",
"snyk",
"sbom",
&args,
])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn log4shell(args: String) -> FnResult<String> {
let stdout = dag()
.pipeline("iac test")?
.pkgx()?
.with_exec(vec![
"pkgx",
"+nodejs.org",
"+bun.sh",
"bunx",
"snyk",
"log4shell",
&args,
])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn container(args: String) -> FnResult<String> {
let stdout = dag()
.pipeline("iac test")?
.pkgx()?
.with_exec(vec![
"pkgx",
"+nodejs.org",
"+bun.sh",
"bunx",
"snyk",
"container",
&args,
])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn iac_test(args: String) -> FnResult<String> {
let stdout = dag()
Expand Down

0 comments on commit 281edce

Please sign in to comment.