Bare metal development environment

Miquel Sabaté Solà edited this page May 20, 2016 · 5 revisions

Maybe you want to write code for Portus with a bare metal setup. This is not recommended, since it might conflict with whatever you might have in your machine. Anyways, here there are some tips:

  • Maybe you want to take a look at some setups that are known to work, like this NGinx setup.
  • In the .gitignore file we ignore a file named bin/portus. You might use this as a script that sets up everything to get Portus working.

As an example of the above, you might configure an NGinx + Puma setup, and then have the following bin/portus script:


# The base directory of the project.
base="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

# Export environment variables if needed.
if [ -z "$PORTUS_KEY_PATH" ]; then
    export PORTUS_KEY_PATH="/etc/nginx/ssl/"
if [ -z "$PORTUS_USE_SSL" ]; then
    export PORTUS_USE_SSL="true"
if [ -z "$PORTUS_MACHINE_FQDN" ]; then

# Check which command to use.
if [ "$1" != "" ]; then

sudo systemctl $cmd mysql nginx registry

# In Puma a restart can be troublesome. Since this script is used for
# development purposes only, a restart will mean to force the stop and then
# start.
if [ "$cmd" = "restart" ]; then
    if [ -f "$base/tmp/pids/" ]; then
        bundle exec pumactl -F $base/../puma.rb stop
bundle exec pumactl -F $base/../puma.rb $cmd

# Crono
if [ -f "$base/tmp/pids/" ]; then
    kill -9 $(cat $base/tmp/pids/
    rm $base/tmp/pids/
if [ "$cmd" != "stop" ]; then
    bundle exec crono -P $base/tmp/pids/ -L $base/log/crono.log -d true

Note that this script assumes that the Puma configuration is placed in the parent directory of the Portus working directory.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.