Skip to content

Commit

Permalink
add more commands
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jun 19, 2024
1 parent 0c172e3 commit 5009542
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = "Set up your CI/CD Pipeline with a specific version of Cue"
edition = "2021"
license = "MIT"
name = "packer"
version = "0.1.0"
version = "0.1.1"

[lib]
crate-type = [
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ fluentci run --wasm packer setup
| fix | Fixes templates from old versions of packer |
| fmt | Rewrites HCL2 config files to canonical format |
| hcl2_upgrade | Transform a JSON template into an HCL2 configuration |
| init | Install missing plugins or upgrade plugins |
| inspect | See components of a template |
| plugins | Interact with Packer plugins and catalog |
| validate | Check that a template is valid |

## Code Usage
Expand Down
2 changes: 1 addition & 1 deletion fluentci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ authors = [
description = "CI/CD Plugin for Packer"
license = "MIT"
name = "packer"
version = "0.1.0"
version = "0.1.1"
27 changes: 27 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,33 @@ pub fn setup(version: String) -> FnResult<String> {
Ok(stdout)
}

#[plugin_fn]
pub fn init(args: String) -> FnResult<String> {
let stdout = dag()
.pkgx()?
.with_exec(vec!["pkgx", "packer", "init", &args])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn inspect(args: String) -> FnResult<String> {
let stdout = dag()
.pkgx()?
.with_exec(vec!["pkgx", "packer", "inspect", &args])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn plugins(args: String) -> FnResult<String> {
let stdout = dag()
.pkgx()?
.with_exec(vec!["pkgx", "packer", "plugins", &args])?
.stdout()?;
Ok(stdout)
}

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

0 comments on commit 5009542

Please sign in to comment.