-
-
Save wayneeseguin/444418 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
project_root="${project_root:-"/srv/cms/current/"}" | |
home_dir="${home_dir:-"/home/capdeploy"}" | |
rvm_path="${rvm_path:-"$home_dir/.rvm"}" | |
port="${1:-8000}" | |
environment="${2:-production}" | |
pids_path="${project_root}/tmp/pids/" | |
command="${3:-start}" | |
# It is important that we setup the RVM environment from .bashrc | |
# and/or using project .rvmrc in $project_root | |
. "$home_dir/.bashrc" | |
cd "${project_root}" | |
mkdir -p "$pids_path" | |
# Might also want ot think about explicitely setting the log path :) | |
exec thin --daemonize --environment ${environment} --port ${port} --pid $project_root/tmp/pids/thin.${port}.pid ${command} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment