Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ When preparing your runtime, this engine compiles code by doing the following:
This engine provides helper scripts to make managing your Elixir application easier.

### node-attach
The `node-attach` helper facilitates connecting to an Elixir node that was started with `elixir-start`.
The `node-attach` helper facilitates connecting to an Elixir node that was started with `node-start`.

```bash
node-attach
Expand All @@ -40,6 +40,13 @@ node-start mix phoenix.server
node-start mix run —no-halt
```

### node-stop
The `node-stop` helper ensures that an Elixir node started with `node-start` is stopped gracefully.

```bash
node-stop
```

## Configuration Options
This engine exposes configuration options through the [boxfile.yml](http://docs.nanobox.io/boxfile/), a yaml config file used to provision and configure your app's infrastructure when using Nanobox. This engine makes the following options available.

Expand Down
8 changes: 4 additions & 4 deletions files/bin/node-attach
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
#
#
# A simple wrapper to facilitate connecting to an elixir
# node that was started with `elixir-start`
#
# node that was started with `node-start`
#
# Usage:
# node-attach
#
#

# exit if any any command fails
set -e
Expand Down
21 changes: 21 additions & 0 deletions files/bin/node-stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#
# A simple wrapper to facilitate stopping an elixir node that was
# started with `node-start`
#
# Usage:
# node-stop
#

# exit if any any command fails
set -e

# establish the name and cookie (if available)
name="stop@$(hostname -i)"
cookie="${COOKIE:-nanobox}"
remote="${HOSTNAME//./-}@$(hostname -i)"

elixir \
--name $name \
--cookie $cookie \
-e ":rpc.call(:\"$remote\", :init, :stop, [])"