Skip to content

Commit

Permalink
Include Bundler in the Ruby package
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Dec 9, 2014
1 parent 9e4a9f4 commit aa8811b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions BUNDLER_VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.7.3
1 change: 1 addition & 0 deletions linux/build
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ exec docker run \
-e "APP_UID=`id -u`" \
-e "APP_GID=`id -g`" \
-e "RUBY_VERSION=`cat \"$SELFDIR/../RUBY_VERSION.txt\"`" \
-e "BUNDLER_VERSION=`cat \"$SELFDIR/../BUNDLER_VERSION.txt\"`" \
-e "ARCHITECTURE=$ARCHITECTURE" \
-e "CONCURRENCY=$CONCURRENCY" \
-e "SETUP_SOURCE=$SETUP_SOURCE" \
Expand Down
1 change: 1 addition & 0 deletions linux/internal/build
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ echo $ARCHITECTURE > $ROOT/system/NAME
echo $APP_UID > $ROOT/system/APP_UID
echo $APP_GID > $ROOT/system/APP_GID
echo $RUBY_VERSION > $ROOT/system/RUBY_VERSION
echo $BUNDLER_VERSION > $ROOT/system/BUNDLER_VERSION
echo $CONCURRENCY > $ROOT/system/CONCURRENCY
echo $SETUP_SOURCE > $ROOT/system/SETUP_SOURCE
echo $COMPILE > $ROOT/system/COMPILE
Expand Down
3 changes: 2 additions & 1 deletion linux/internal/build-inside-mock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ NAME=`cat /system/NAME`
APP_UID=`cat /system/APP_UID`
APP_GID=`cat /system/APP_GID`
RUBY_VERSION=`cat /system/RUBY_VERSION`
BUNDLER_VERSION=`cat /system/BUNDLER_VERSION`
CONCURRENCY=`cat /system/CONCURRENCY`
SETUP_SOURCE=`cat /system/SETUP_SOURCE`
COMPILE=`cat /system/COMPILE`
Expand Down Expand Up @@ -171,7 +172,7 @@ echo $GEM_EXTENSION_API_VERSION > /tmp/ruby/info/GEM_EXTENSION_API_VERSION
run rm -rf /tmp/ruby/lib/ruby/gems/$RUBY_COMPAT_VERSION/gems/{test-unit,rdoc}-*

if [[ -e /system/Gemfile ]]; then
run /tmp/ruby/bin/gem install bundler --no-rdoc --no-ri
run /tmp/ruby/bin/gem install bundler -v $BUNDLER_VERSION --no-rdoc --no-ri
run cp /system/Gemfile* /tmp/ruby
echo "+ Entering /tmp/ruby"
pushd /tmp/ruby >/dev/null
Expand Down
9 changes: 5 additions & 4 deletions osx/build
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SELFDIR=`dirname "$0"`
SELFDIR=`cd "$SELFDIR" && pwd`
source "$SELFDIR/internal/reset_environment.sh"
source "$SELFDIR/../shared/library.sh"
BUNDLER_VERSION=`cat "$SELFDIR/../BUNDLER_VERSION.txt"`

WORKDIR=
OWNS_WORKDIR=true
Expand Down Expand Up @@ -263,10 +264,10 @@ if [[ "$GEMFILE" != "" ]]; then
fi

# Install Bundler, either from cache or directly.
if [[ -e "$RUNTIME_DIR/vendor/cache/bundler-1.7.3.gem" ]]; then
run /tmp/ruby/bin/gem install "$RUNTIME_DIR/vendor/cache/bundler-1.7.3.gem" --no-rdoc --no-ri
if [[ -e "$RUNTIME_DIR/vendor/cache/bundler-$BUNDLER_VERSION.gem" ]]; then
run /tmp/ruby/bin/gem install "$RUNTIME_DIR/vendor/cache/bundler-$BUNDLER_VERSION.gem" --no-rdoc --no-ri
else
run /tmp/ruby/bin/gem install bundler -v 1.7.3 --no-rdoc --no-ri
run /tmp/ruby/bin/gem install bundler -v $BUNDLER_VERSION --no-rdoc --no-ri
fi

# Run bundle install.
Expand All @@ -281,7 +282,7 @@ if [[ "$GEMFILE" != "" ]]; then
run /tmp/ruby/bin/bundle package
run rm -rf "$RUNTIME_DIR/vendor"
run mv vendor "$RUNTIME_DIR/"
run cp /tmp/ruby/lib/ruby/gems/$RUBY_COMPAT_VERSION/cache/bundler-1.7.3.gem "$RUNTIME_DIR/vendor/cache/"
run cp /tmp/ruby/lib/ruby/gems/$RUBY_COMPAT_VERSION/cache/bundler-$BUNDLER_VERSION.gem "$RUNTIME_DIR/vendor/cache/"
run rm -rf Gemfile* .bundle
echo "+ Leaving /tmp/ruby"
popd >/dev/null
Expand Down
5 changes: 4 additions & 1 deletion shared/package
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e
SELFDIR=`dirname "$0"`
SELFDIR=`cd "$SELFDIR" && pwd`
source "$SELFDIR/library.sh"
BUNDLER_VERSION=`cat "$SELFDIR/../BUNDLER_VERSION.txt"`

BUILD_OUTPUT_DIR=
RUBY_PACKAGE=
Expand Down Expand Up @@ -108,7 +109,9 @@ if [[ "$RUBY_PACKAGE" != "" ]]; then
--exclude "lib/ruby/gems/$RUBY_COMPAT_VERSION/specifications/" \
.
run tar -rf "$RUBY_PACKAGE.tmp" -C "$BUILD_OUTPUT_DIR" \
"./lib/ruby/gems/$RUBY_COMPAT_VERSION/specifications/default/"
"./lib/ruby/gems/$RUBY_COMPAT_VERSION/gems/bundler-$BUNDLER_VERSION" \
"./lib/ruby/gems/$RUBY_COMPAT_VERSION/specifications/bundler-$BUNDLER_VERSION.gemspec" \
"./lib/ruby/gems/$RUBY_COMPAT_VERSION/specifications/default"
echo "+ gzip --best --no-name -c $RUBY_PACKAGE.tmp > $RUBY_PACKAGE"
gzip --best --no-name -c "$RUBY_PACKAGE.tmp" > "$RUBY_PACKAGE"
run rm "$RUBY_PACKAGE.tmp"
Expand Down

0 comments on commit aa8811b

Please sign in to comment.