azriel91 / peace

Zero Stress Automation
https://peace.mk
Apache License 2.0
112 stars 1 forks source link
automation hacktoberfest rust

πŸ•ŠοΈ peace – zero stress automation

Crates.io docs.rs CI Coverage Status

peace is a framework to build empathetic and forgiving software automation.

See:

Guiding Principles

Features

Symbol Meaning
🟒 Works well
🟑 Partial support
⚫ Planned
πŸ”΅ Compatible by design
🟣 Works, "fun idea"

Roadmap

Further ideas:

Examples

Examples are run using --package instead of --example, as each example is organized as its own crate.

download example ```bash cargo run --package $example_name --all-features # e.g. cargo build --package download --all-features cargo run -q --package download --all-features -- init https://ifconfig.me ip.json for cmd in status goal diff ensure ensure diff clean clean diff do printf "=== ${cmd} ===\n" cargo run -q --package download --all-features -- --format text $cmd printf '\n' done # Look at metadata that Peace has saved find .peace -type f -exec bash -c 'echo \# {}; cat {}; echo' \; # Clean up the metadata directory rm -rf .peace ``` ### WASM The `download` example can be built as a web assembly application using [`wasm-pack`]: ```bash cd examples/download wasm-pack build --target web ``` In the `examples/download` directory, start an [HTTP server], and open : ```bash python3 -m http.server 8000 # or simple-http-server --nocache --port 8000 -i ``` [`wasm-pack`]: https://rustwasm.github.io/ [HTTP server]: https://crates.io/crates/simple-http-server
envman example 1. Install [`cargo-leptos`](https://github.com/leptos-rs/cargo-leptos). ```bash cargo install --locked cargo-leptos ``` 2. Build the `envman` example: ```bash # defined in .cargo/config.toml cargo envman_build_debug ``` 3. Copy artifacts to a temporary directory: ```bash demo_dir=/tmp/demo/envman test -d "${demo_dir}" || mkdir -p "${demo_dir}" cp ./target/debug/envman "${demo_dir}" cp ./target/web/envman/pkg "${demo_dir}" ``` 4. Switch to the demo directory: ```bash demo_dir=/tmp/demo/envman cd "${demo_dir}" ``` 5. Make sure you have AWS credentials set up in `~/.aws/credentials`. 6. Run the appropriate `envman` commands: 1. Initialize a project: ```bash # initialize a project to download from `azriel91/web_app` ./envman init \ --type development \ --flow deploy \ demo_1 azriel91/web_app 0.1.1 ``` 2. Status / Goal / Diff: ```bash ./envman status ./envman goal ./envman diff ``` 3. Deploy / Clean ```bash ./envman deploy ./envman deploy --format json ./envman deploy --format none ./envman clean ./envman clean --format json ./envman clean --format none ``` 4. You can also interrupt the deploy/clean process. 7. Run the web interface: ```bash ./envman web ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.