Sha256: 8d10d5e6f29755f3c53c710d29885249c29617adcc2ed8651109ded525d8398a

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

#!/bin/bash -e

shift # get rid of unicorn argument

export PATH="/data/zendesk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export UNICORN_PID=<%= File.join(node[:project_dir], node[:run_dir], "unicorn.pid") %>
export HOME="<%= node[:home_dir] %>"

case $1 in
  start*)
    unset LS_COLORS
    unset BUNDLE_GEMFILE GEM_PATH GEM_HOME RUBYOPT

    <%= node[:ruby_loader] %> <%= node[:app_ruby] %> bundle check 2>&1 >/dev/null || { bundle install --quiet --local --path vendor/bundle || bundle check > /dev/null; }
    exec <%= node[:ruby_loader] %> <%= node[:app_ruby] %> bundle exec <%= node[:unicorn_exec] %> -c <%= File.join(node[:project_dir], node[:app_dir], "config", "unicorn.rb") %> -E <%= node[:app_env] %> -D
    ;;

  stop*)
    [[ -f $UNICORN_PID ]] && kill -TERM $(cat $UNICORN_PID)
    ;;

  reload*)
    [[ -f $UNICORN_PID ]] && kill -HUP $(cat $UNICORN_PID)
    ;;

  deploy*)
    [[ -f $UNICORN_PID ]] && kill -USR2 $(cat $UNICORN_PID)
    ;;

  logrotate*)
    [[ -f $UNICORN_PID ]] && kill -USR1 $(cat $UNICORN_PID)
    ;;

  *)
    echo 2>&1 "ERROR: unrecognized action : $1"
    exit 1
    ;;
esac

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tvd-unicorn-0.0.4 cookbooks/unicorn/templates/default/server.erb