Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Move JRuby and bundle install to script/jruby instead of pom.xml #1

Merged
merged 1 commit into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 27 additions and 57 deletions.
  1. +0 −39 pom.xml
  2. +27 −18 script/jruby
View
39 pom.xml
@@ -6,48 +6,9 @@
<name>travis-hub-app</name>
<packaging>jar</packaging>
<dependencies>
- <dependency>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- <version>1.6.5</version>
- </dependency>
- <dependency>
- <groupId>org.jruby.plugins</groupId>
- <artifactId>jruby-rake-plugin</artifactId>
- <version>1.6.5</version>
- </dependency>
</dependencies>
<build>
<plugins>
- <plugin>
- <groupId>org.jruby.plugins</groupId>
- <artifactId>jruby-rake-plugin</artifactId>
- <version>1.6.5</version>
- <executions>
- <execution>
- <id>install-bundler</id>
- <phase>process-resources</phase>
- <goals>
- <goal>jruby</goal>
- </goals>
- <configuration>
- <args>-S gem install bundler --pre --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>
View
45 script/jruby
@@ -1,21 +1,32 @@
#!/bin/sh
APPDIR=`pwd`
-REPO="$APPDIR"/.m2/repository
+JRUBY_VERSION="1.6.5"
-export CLASSPATH=$CLASSPATH_PREFIX:$APPDIR/etc:$REPO/org/jruby/jruby-complete/1.6.5/jruby-complete-1.6.5.jar
+export CLASSPATH=$CLASSPATH_PREFIX:$APPDIR/etc
export GEM_HOME=$APPDIR/vendor/bundle
export GEM_PATH=$APPDIR/.gems:$APPDIR/vendor/bundle
-export PATH=$APPDIR/.gem/bin:$APPDIR/vendor/bundle/bin:$PATH
+export PATH=$APPDIR/.gems/bin:$APPDIR/vendor/bundle/bin:$PATH
export BUNDLE_GEMFILE=$APPDIR/Jemfile
-export JRUBY_OPTS=--1.9
+#export JRUBY_OPTS=--1.9
-# echo "APPDIR : $APPDIR"
-# echo "REPO : $REPO"
-# echo "CLASSPATH : $CLASSPATH"
-# echo "GEM_PATH : $GEM_PATH"
-# echo "PATH : $PATH"
-# echo "bundler_env : $bundler_env"
+# Download a JRuby if needed
+if [ ! -d jruby-${JRUBY_VERSION} ]; then
+ curl -o jruby-bin-${JRUBY_VERSION}.tar.gz "http://jruby.org.s3.amazonaws.com/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz"
+ tar -xzf jruby-bin-${JRUBY_VERSION}.tar.gz
+ rm jruby-bin-${JRUBY_VERSION}.tar.gz
+fi
+
+# Add JRuby to the path
+export PATH=${APPDIR}/jruby-${JRUBY_VERSION}/bin:$PATH
+
+# Install Bundler if needed
+if ! jruby -S gem list | grep bundler > /dev/null; then
+ jruby -S gem install bundler --pre --no-ri --no-rdoc --install-dir .gems
+fi
+
+# Install gems
+bundle install --gemfile=Jemfile
max_mem=500m
max_stack=2048k
@@ -32,12 +43,10 @@ max_stack=2048k
# echo `env`
# echo `cat .bundle/config`
-java $JAVA_OPTS \
- -Dfile.encoding=UTF-8 -Xmx$max_mem -Xss$max_stack \
- -Djruby.memory.max=$max_mem -Djruby.stack.max=$max_stack \
- -Dsun.java.command=org.jruby.Main \
- -Djruby.compat.version=1.9 \
- -classpath "$CLASSPATH" \
- -Dbasedir="$APPDIR" \
- org.jruby.Main \
+jruby \
+ -J-Dfile.encoding=UTF-8 -J-Xmx$max_mem -J-Xss$max_stack \
+ -J-Djruby.memory.max=$max_mem -J-Djruby.stack.max=$max_stack \
+ -J-Dsun.java.command=org.jruby.Main \
+ -J-classpath "$CLASSPATH" \
+ -J-Dbasedir="$APPDIR" \
"$@"
Something went wrong with that request. Please try again.