Declarative shell scripting using Rust native bindings inspired by Ansible
For installation and usage, see our Documentation.
Manage your docker entrypoints in a declarative style.
If you:
Or use it for your local scripts!
Then keep on reading.
Here is Rash!
Imperative: entrypoint.sh
:
```bash
set -e
REQUIREDPARAMS=" VAULTURL VAULTROLEID VAULTSECRETID VAULTSECRETPATH "
for required in $REQUIRED_PARAMS ; do [[ -z "${!required}" ]] && echo "$required IS NOT DEFINED" && exit 1 done
echo "[$0] Logging into Vault..." VAULTTOKEN=$(curl -s $VAULTURL/v1/auth/approle/login \ --data '{"roleid": "'$VAULTROLEID'","secretid": "'$VAULTSECRETID'"}' \ | jq -r .auth.client_token)
echo "[$0] Getting Samuel API key from Vault..." export APP1APIKEY=$(curl -s -H "X-Vault-Token: $VAULTTOKEN" \ $VAULTURL/v1/$VAULTSECRETPATH | jq -r .data.api_key)
exec "$@" ```
Declarative: entrypoint.rh
```yaml
name: Verify input parameters assert: that:
name: launch docker CMD command: {{ rash.argv }} transferpid: yes env: APP1APIKEY: "{{ lookup('vault', env.VAULTSECRET_PATH ) }}" ```
All you need to run Rash is a Linux kernel!
You can use it in your favorite IoT chips running Linux or in containers from scratch!
Stable API with few modules. It will be growing, stay tuned.
rash