Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gootik/rebar_cmd
A rebar plugin for running custom commands
https://github.com/gootik/rebar_cmd
erlang rebar
Last synced: 17 days ago
JSON representation
A rebar plugin for running custom commands
- Host: GitHub
- URL: https://github.com/gootik/rebar_cmd
- Owner: gootik
- License: other
- Created: 2016-04-12T16:29:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-14T22:25:00.000Z (over 3 years ago)
- Last Synced: 2024-10-13T18:46:24.342Z (about 1 month ago)
- Topics: erlang, rebar
- Language: Erlang
- Homepage:
- Size: 26.4 KB
- Stars: 16
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rebar_cmd [![Build Status](https://github.com/gootik/rebar_cmd/workflows/build/badge.svg)](https://github.com/gootik/rebar_cmd) [![Hex.pm](https://img.shields.io/hexpm/v/rebar_cmd.svg)](https://hex.pm/packages/rebar_cmd)
Run custom shell commands with `rebar3 cmd `.
## Purpose
The goal of this plugin is to allow `rebar3` to run additional commands, so
that one can use it solely to manage everything in an Erlang project.Whether it is bringing Docker containers up, tagging a new Git release or
deleting log files, you should be able to use a single build tool.## How it works
This is a very simple and straightforward plugin. Simply describe your
command in `rebar.config` and execute (just like you would Linux aliases)
with `rebar3 cmd `.## Usage
Add the plugin to your `rebar.config`:
```erlang
{plugins, [
{rebar_cmd, "0.2.6"}
]}.{commands, [
{docker_up, "docker-compose up -d"},
{sync, "git fetch upstream && git merge upstream/master"}
]}.
```The example above shows you how to describe a command to bring your
Docker containers up, as well as another one to sync a Git repository
with remote master.Some options are available, as described below:
* `[{timeout, }]` (defaults to `15000`)
* `[{verbose, }]` (defaults to `false`)e.g. you could change the previous `docker_up` command to have it fail
after 5s with `{docker_up, "docker-compose up -d", [{timeout, 5000}]},`.
You could also get more info from the shell for the above command
`sync` with
`{sync, "git fetch upstream && git merge upstream/master", [{verbose, true}]}`Check it out:
```bash
$ rebar3 cmd sync
===> Analyzing applications...
===> Compiling rebar_cmd
===> Command sync resulted in: "Already up to date."
```