devrel-mode
is an emacs minor mode for working with devrel's while
developing Riak. It is quickly slapped together and probably poorly
written given its my first attempt at writing a mode in elisp.
Some assumptions are made about how you layout your directories while
working on Riak. Specifically, devrel-mode
assumes your directory
structure looks something like:
+ parent-dir
|
---- riak-dep-under-dev
---- riak
That is to say, you are working on some dependency of Riak and it is
cloned to parent-dir
. In addition you have a clone of basho/riak
also inside parent-dir
(so its a sibling directory of the
dependency). You should be able to work with multiple dependencies in
this structure (although its untested). If instead you prefer to
develop Riak by downloading the deps and editing their source files
directly (e.g. in deps/<something>/src
) then devrel-mode
does not
support you (yet -- it should be an easy change and sometimes I work
this way too. PR and/or beers accepted).
It is also assumed that you have built a devrel in the riak
directory once. devrel-mode
is meant to take you from there
(although I'm sure it falls short in a few places).
devrel-mode
also assumes you use
edts. Actually, you probably
don't need edts-mode
enabled on your buffer to use devrel-mode
but
for things like riak console
support devrel-mode
uses EDTS
functions so it should be loaded in Emacs. In addition, several of the
functions (specifically the ones that update beam files) assume that
you have compiled the file w/ recent changes (they don't compile for
you). This is made much easier by using EDTS. You must at least be
using erlang-mode
in order for devrel-mode to start automatically
(it uses the mode's hook).
This mode, stupidly, has a hard-coded list of Riak dependencies. The
list, so far, only contains riak_core
and riak_kv
(see
here). This
is only used in the hook that enables devrel-mode
. These are the
only deps I've worked w/ so far but it should work for others. Extend
it and submit PR after testing (or wait til I do :)).
Clone this repo. Add the path to your Emacs load path and (require 'devrel-mode)
.
devrel-mode comes with the following built in commands. All commands
are prefixed with the key binding C-x C-r
.
C-r
- display list of running nodes (pinging each one to determine if they are up)s n
- start nodes usingriak start
. will prompt for a list of which (dev1 - devN)x n
- stops a node usingriak stop
. will prompt for which (dev1 - devN)r n
- restarts a node usingriak stop
thenriak start
. will prompt for which (dev1 - devN)C-c
- displays (and possibly starts usingriak console
) the console for a node. Will prompt for which (dev1 - devN)m s
- displays member status (using dev1) for the devrelr s
- displays ring status (using dev1) for the devrelC-x
- resets nodes (stops them and deletes their data directories)c j
- join a node to the cluster. prompts for which node to join to which (dev1 - devN).c l
- tells the specified node to leave the cluster. prompts for which node (dev1 - devN).c p
- runsriak-admin cluster plan
from dev1c c
- runsriak-admin cluster commit
from dev1c b
- builds a cluster, stopping and resetting any running nodes. prompts for which nodes to build the cluster from (dev1 - devN).C-b
- update BEAM for buffer. finds the corresponding BEAM file for the Erlang file in the buffer and copies it into the right places in the devrelC-a
- update all BEAM files for dependency. Given current buffer determine the riak dependency (e.g. riak_core) and update all beam files in the devrel nodes for it.M-b
- update BEAM inriak_test
current. finds the corresponding BEAM file for the Erlang file in the buffer and updates thecurrent
devrel inriak_test
. The environment variableRT_DEST_DIR
must be set to the root ofriak_test
's riak directories (e.g./path/to/rt/riak
).M-a
- update all BEAM files for dependency inriak_test
current. SeeM-b
above.
devrel-mode
works with two buffers: *msgs devrel-mode*
and
*devrel-mode*
. The latter is shown to you when necessary but it may
be beneficial to know about them if things go wrong.
See LICENSE.txt
.