Created
November 24, 2015 16:27
-
-
Save crohr/b4a0c980173d9d2c0826 to your computer and use it in GitHub Desktop.
Simple postinstall file for rails apps on https://packager.io
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/sh | |
set -e | |
CLI="my-app" | |
# if a DATABASE_URL is properly configured, then we can run migrations and web process | |
if $CLI config:get DATABASE_URL ; then | |
$CLI run rake db:migrate | |
$CLI scale web=1 | |
fi | |
# If sidekiq url is present, then start worker process | |
if $CLI config:get SIDEKIQ_URL ; then | |
$CLI scale worker=1 | |
fi | |
# Simple (i.e. stop then start) restart | |
service my-app restart | |
# or, Puma rolling restart | |
$CLI run pumactl restart | |
# or, Unicorn rolling restart? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment