forked from mazondo/Punchy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Jemfile - Procfile - pom.xml - script/jruby - requisite changes for config/database.yml
- Loading branch information
Showing
6 changed files
with
192 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
source 'http://rubygems.org' | ||
|
||
gem 'rails', '3.0.0' | ||
gem "will_paginate" | ||
gem "acts-as-taggable-on" | ||
gem "gchartrb" | ||
|
||
group :development, :test do | ||
gem 'activerecord-jdbcsqlite3-adapter' | ||
end | ||
|
||
group :production do | ||
gem 'activerecord-jdbcpostgresql-adapter' | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
web: sh script/jruby script/rails server -p $PORT | ||
console: sh script/jruby script/rails console | ||
rake: sh script/jruby -S rake | ||
jruby: sh script/jruby |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>au.com.mathew</groupId> | ||
<artifactId>jruby-heroku</artifactId> | ||
<version>1.0</version> | ||
<name>webapp</name> | ||
<packaging>jar</packaging> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby-complete</artifactId> | ||
<version>1.6.3</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jruby.plugins</groupId> | ||
<artifactId>jruby-rake-plugin</artifactId> | ||
<version>1.6.3</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jruby.plugins</groupId> | ||
<artifactId>jruby-rake-plugin</artifactId> | ||
<version>1.6.3</version> | ||
<executions> | ||
<execution> | ||
<id>install-bundler</id> | ||
<phase>process-resources</phase> | ||
<goals> | ||
<goal>jruby</goal> | ||
</goals> | ||
<configuration> | ||
<args>-S gem install bundler --no-ri --no-rdoc --install-dir .gems</args> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>bundle-install</id> | ||
<phase>process-resources</phase> | ||
<goals> | ||
<goal>jruby</goal> | ||
</goals> | ||
<configuration> | ||
<args> | ||
-e ENV['GEM_HOME']=File.join(Dir.pwd,'.gems');ENV['GEM_PATH']=File.join(Dir.pwd,'.gems');ENV['BUNDLE_GEMFILE']=File.join(Dir.pwd,'Jemfile');require'rubygems';require'bundler';require'bundler/cli';cli=Bundler::CLI.new;cli.install | ||
</args> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
#!/bin/sh | ||
# ---------------------------------------------------------------------------- | ||
# Copyright 2001-2006 The Apache Software Foundation. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ---------------------------------------------------------------------------- | ||
|
||
# Copyright (c) 2001-2002 The Apache Software Foundation. All rights | ||
# reserved. | ||
|
||
APPDIR=`pwd` | ||
BASEDIR=`dirname $0`/.. | ||
BASEDIR=`(cd "$BASEDIR"; pwd)` | ||
|
||
# OS specific support. $var _must_ be set to either true or false. | ||
cygwin=false; | ||
darwin=false; | ||
case "`uname`" in | ||
CYGWIN*) cygwin=true ;; | ||
Darwin*) darwin=true | ||
if [ -z "$JAVA_VERSION" ] ; then | ||
JAVA_VERSION="CurrentJDK" | ||
else | ||
echo "Using Java version: $JAVA_VERSION" | ||
fi | ||
if [ -z "$JAVA_HOME" ] ; then | ||
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home | ||
fi | ||
;; | ||
esac | ||
|
||
if [ "$darwin" = "false" ] && [ $cygwin = "false" ]; then | ||
APPDIR="$(dirname $(dirname $(readlink -fn "$0")))" | ||
fi | ||
|
||
if [ -z "$JAVA_HOME" ] ; then | ||
if [ -r /etc/gentoo-release ] ; then | ||
JAVA_HOME=`java-config --jre-home` | ||
fi | ||
fi | ||
|
||
# For Cygwin, ensure paths are in UNIX format before anything is touched | ||
if $cygwin ; then | ||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` | ||
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` | ||
fi | ||
|
||
# If a specific java binary isn't specified search for the standard 'java' binary | ||
if [ -z "$JAVACMD" ] ; then | ||
if [ -n "$JAVA_HOME" ] ; then | ||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
# IBM's JDK on AIX uses strange locations for the executables | ||
JAVACMD="$JAVA_HOME/jre/sh/java" | ||
else | ||
JAVACMD="$JAVA_HOME/bin/java" | ||
fi | ||
else | ||
JAVACMD=`which java` | ||
fi | ||
fi | ||
|
||
if [ ! -x "$JAVACMD" ] ; then | ||
echo "Error: JAVA_HOME is not defined correctly." | ||
echo " We cannot execute $JAVACMD" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$REPO" ] | ||
then | ||
REPO="$BASEDIR"/repo | ||
fi | ||
|
||
CLASSPATH=$CLASSPATH_PREFIX:"$BASEDIR"/etc:"$REPO"/org/jruby/jruby-complete/1.6.3/jruby-complete-1.6.3.jar | ||
EXTRA_JVM_ARGUMENTS="" | ||
|
||
# For Cygwin, switch paths to Windows format before running java | ||
if $cygwin; then | ||
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"` | ||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` | ||
[ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"` | ||
[ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"` | ||
[ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"` | ||
fi | ||
|
||
export GEM_HOME="$APPDIR"/.gems | ||
export GEM_PATH=$GEM_HOME | ||
export PATH="$GEM_PATH"/bin:$PATH | ||
export BUNDLE_GEMFILE="$APPDIR"/Jemfile | ||
|
||
# Test if Heroku's environment variables are set. | ||
# If they are, we're running on Heroku and should | ||
# set our RAILS_ENV to production | ||
This comment has been minimized.
Sorry, something went wrong. |
||
if [ -n "${DATABASE_URL}" ] && [ -n ${PORT} ] && [ "${APPDIR}" = "/app" ]; then | ||
echo "Detected that we are running on Heroku. Setting RAILS_ENV=production" | ||
export RAILS_ENV=production | ||
fi | ||
|
||
exec "$JAVACMD" $JAVA_OPTS \ | ||
$EXTRA_JVM_ARGUMENTS \ | ||
-classpath "$CLASSPATH" \ | ||
-Dbasedir="$BASEDIR" \ | ||
-Xmx256m \ | ||
-Xss2048k \ | ||
org.jruby.Main \ | ||
"$@" |
You should consider just doing
heroku config:add RAILS_ENV=production
instead of this