Skip to content

Commit

Permalink
feat: add setup and deploy commands
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 4, 2024
1 parent 842a452 commit 215486c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 15 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 = "Blazing fast deployer and server automation tool"
edition = "2021"
license = "MIT"
name = "mina"
version = "0.1.0"
version = "0.1.1"

[lib]
crate-type = [
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ This plugin install and run [mina](https://github.com/mina-deploy/mina) on your
Add the following command to your CI configuration file:

```bash
fluentci run --wasm mina setup
fluentci run --wasm mina install
```

## Functions

| Name | Description |
| --------- | ------------------------------------------ |
| setup | Install mina |
| Name | Description |
| --------- | ----------------------------------------- |
| install | Install mina |
| setup | Setup mina |
| deploy | Deploy your project using mina |

## Code Usage

Expand All @@ -35,7 +37,7 @@ use fluentci_pdk::dag;

// ...

dag().call("https://pkg.fluentci.io/mina@v0.1.0?wasm=1", "setup", vec![])?;
dag().call("https://pkg.fluentci.io/mina@v0.1.0?wasm=1", "install", vec![])?;
```

## 📚 Examples
Expand All @@ -49,7 +51,7 @@ Github Actions:
wasm: true
plugin: mina
args: |
setup
install
- name: Show mina version
run: |
flox activate -- type mina
Expand Down
12 changes: 6 additions & 6 deletions fluentci.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
authors = [
"Tsiry Sandratraina <tsiry.sndr@fluentci.io>"
"Tsiry Sandratraina <tsiry.sndr@fluentci.io>",
]
description = "CI/CD Plugin for Mina"
license = "MIT"
name = "mina"
version = "0.1.0"
keywords = [
"mina",
"deploy"
]
"deploy",
]
license = "MIT"
name = "mina"
version = "0.1.1"
25 changes: 24 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
use std::vec;

use extism_pdk::*;
use fluentci_pdk::dag;

pub mod helpers;

#[plugin_fn]
pub fn setup(_args: String) -> FnResult<String> {
pub fn install(_args: String) -> FnResult<String> {
let stdout = helpers::setup_mina()?;
Ok(stdout)
}

#[plugin_fn]
pub fn setup(args: String) -> FnResult<String> {
helpers::setup_mina()?;
let stdout = dag()
.flox()?
.with_exec(vec!["mina", "setup", &args])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn deploy(args: String) -> FnResult<String> {
helpers::setup_mina()?;
let stdout = dag()
.flox()?
.with_exec(vec!["mina", "deploy", &args])?
.stdout()?;
Ok(stdout)
}

0 comments on commit 215486c

Please sign in to comment.