rem
rem
is a tool for managing remote bash scripts.
It is meant to be used in CI/CD contexts and for local automation purposes. rem
can import script libraries into new scripts, or run scripts directly in your command line.
Example
# Add a github repository
# Import the repository
# Add your private repositories (password will be read from $TOKEN)
# Run your scripts whenever you need them
# Pin your scripts to a specific ref
How to install
rem
is written in Rust and can be installed using the Cargo package manager.
If you don't have Rust installed, rustup is recommended. You'll need the latest nightly version of the Rust toolchain:
# Install rust
|
# Switch to nightly
Script sources
Right now, github and gitlab are supported through the API. You can save any number of scripts in your local repository list simply by providing the URL and giving them an alias:
# Use either a short version
# Or the full URL
# Provide a token/password through stdin
|
# Or read it from a variable everytime you run the script
# List your local repositories
# And remove them
Your added repositories will be saved at $HOME/.remconf.toml
. It is recommended to use the --password-env
option so you don't accidentally leave any plaintext passwords in your bash history.
In CI/CD contexts, this is also the preferred way since you can safely build docker images with configured repos in them. The only thing stored in the configuration will be the name of the variable the token will be read from.
TODO
The tool is in a usable state right now, but there's a few things missing for it to be reliable and useful in more contexts. Here are the things I have planned:
- Support raw git repositories from any providers
- Support scripts from non-git sources
- Allow validating saved repositories
- Add local caching for offline contexts
- Validate scripts before they are run (shebang, static analysis, arbitrary checks)
- Add tests