build_p4ruby.sh #1

  • //
  • guest/
  • surajdolby/
  • p4ruby/
  • tools/
  • build_p4ruby.sh
  • View
  • Commits
  • Open Download .zip Download (1 KB)
#!/usr/bin/env bash
#
# build_p4ruby.sh
#
# This provides our "build step" for the CD chain. We perform tests using the
# latest build of p4d and the p4api. If it's all ok, then the prelease gem
# is uploaded to our internal Gem server for further validation.
#
# Installation Dependencies
# -------------------------
#
# - RVM to manage the Ruby installation
# - The RVM version under test should have the 'inabox' gem installed and
#   configured to post to http://geminabox.das.perforce.com
# - Ant to execute our DocBook installation
#
# Usage
# -----
#

set -e
export PATH="$PATH:$HOME/.rvm/bin"

# Note that rvm seems to select 2.1.3 if you just specify 2.1
echo "RUBY_USE_VERSION=${RUBY_USE_VERSION}"

rvm use ${RUBY_USE_VERSION}

set -v

bundle install

if [ ! -f work/p4d ]; then
    gem install p4util --version 0.0.3
    p4util download p4d
    gem uninstall p4util p4ruby
fi

bundle exec rake compile test package build.properties

# Note that this requires RUBY_CC_VERSION set to the available Ruby versions
# and P4RUBY_CROSS_PLATFORM set to the right platform
if [ -n "${P4RUBY_CROSS_PLATFORM}" ]; then
    bundle exec rake cross native gem
fi

gem inabox pkg/p4ruby*.gem -g http://geminabox.das.perforce.com

# Change User Description Committed
#1 15524 surajdolby Populate -o //guest/perforce_software/p4ruby/main/...
//guest/surajdolby/p4ruby/....
//guest/perforce_software/p4ruby/main/tools/build_p4ruby.sh
#11 14713 tjuricek Only running cross compile step if P4RUBY_CROSS_PLATFORM is set

Imported from Git
 Author: Tristan Juricek <[email protected]> 1423091068 -0800
 Committer: Tristan Juricek <[email protected]> 1423091068 -0800
 sha1: 559f798726afdd0a5fd971157bc5a8fd0695e44e
 push-state: complete
 parent-changes: d2ffb23c0a5b318c3f0c717b5c99d80a635e6852=[998355]
#10 14703 tjuricek Set up call to 'rake cross native gem' as the main build step now.

This utilizes the 'cross compile' feature where we can build multiple versions of ruby under one gem package, though it's really going to be used for 'direct compilation'. The following variables need to be set to run the tools/build_p4ruby.sh now:

* RUBY_USE_VERSION - Should be the rvm version with the gem for publishing to geminabox
* RUBY_CC_VERSION - The colon (:) delimited string of ruby versions to build - each version should be installed via RVM and registered in ~/.rake_compiler/config.yml
* P4RUBY_CROSS_PLATFORM - The platform ID we are building on, needs to be set, e.g., 'x86_64-linux', 'i686-linux', 'x86_64-darwin-11'. Note that OS X uses the darwin 'version'.

P4RUBY-176

Imported from Git
 Author: Tristan Juricek <[email protected]> 1421184895 -0800
 Committer: Tristan Juricek <[email protected]> 1421184895 -0800
 sha1: 1e9e81f882ba0584a7bc66a48637a6576aee7cb9
 push-state: complete
 parent-changes: 50a9ca3b8ecb1e77ba823cbde20a7c89bd731d86=[984317]
#9 14702 tjuricek Roll back to an older version of p4util for this scripting madness.

Imported from Git
 Author: Tristan Juricek <[email protected]> 1421104861 -0800
 Committer: Tristan Juricek <[email protected]> 1421104861 -0800
 sha1: 50a9ca3b8ecb1e77ba823cbde20a7c89bd731d86
 push-state: complete
 parent-changes: 475c8a28e0034fdba76a1dc32fdec262d8eb9d09=[984303]
#8 14701 tjuricek Change environment variable name to one that may not be overridden by bash login scripts.

Imported from Git
 Author: Tristan Juricek <[email protected]> 1421104593 -0800
 Committer: Tristan Juricek <[email protected]> 1421104593 -0800
 sha1: 475c8a28e0034fdba76a1dc32fdec262d8eb9d09
 push-state: complete
 parent-changes: fd910ea269fb5233d30da5100f63a622437c066f=[984292]
#7 14700 tjuricek Require environment to specify ruby version, do not default

Imported from Git
 Author: Tristan Juricek <[email protected]> 1421104459 -0800
 Committer: Tristan Juricek <[email protected]> 1421104459 -0800
 sha1: fd910ea269fb5233d30da5100f63a622437c066f
 push-state: complete
 parent-changes: f8a70c9e34bfb7f29fabeb98fe7b0512dc98d5e5=[984265]
#6 14699 tjuricek Only build the pre-compiled gem in the build script.

We'll package up the source gem in a different script.

Imported from Git
 Author: Tristan Juricek <[email protected]> 1421103797 -0800
 Committer: Tristan Juricek <[email protected]> 1421103797 -0800
 sha1: f8a70c9e34bfb7f29fabeb98fe7b0512dc98d5e5
 push-state: complete
 parent-changes: 2c1c37317fe8836ade098b1e0e40ae16e5db32cc=[984262]
#5 14698 tjuricek Removing direct dependency for p4util at the moment, since it has a circular dependency on p4ruby.

Imported from Git
 Author: Tristan Juricek <[email protected]> 1421103650 -0800
 Committer: Tristan Juricek <[email protected]> 1421103650 -0800
 sha1: 2c1c37317fe8836ade098b1e0e40ae16e5db32cc
 push-state: complete
 parent-changes: 5d56ba62b673bd8c8ee78587dc6cc43365b6ac5d=[984228]
#4 14697 tjuricek Revise bash 'build' script, and move dependency declarations for bundler.

It should now allow for setting the RUBY_VERSION environment variable, and should try to publish the precompiled gem to the internal gem server for testing.

P4RUBY-176

Imported from Git
 Author: Tristan Juricek <[email protected]> 1421100863 -0800
 Committer: Tristan Juricek <[email protected]> 1421100863 -0800
 sha1: 5d56ba62b673bd8c8ee78587dc6cc43365b6ac5d
 push-state: complete
 parent-changes: 80da9291ba8705d8e89946adbf3668173dd624a4=[984070]
#3 14691 tjuricek Removing p4util from .gemspec and only referencing it in the build shell script.

Until there is a 'GA release' of the p4ruby gem, we will have to install p4util indirectly.

Imported from Git
 Author: Tristan Juricek <[email protected]> 1417551930 -0800
 Committer: Tristan Juricek <[email protected]> 1417551930 -0800
 sha1: 9755260c44bc372252b09a7259b2bb340b85cabc
 push-state: complete
 parent-changes: 07b676b152f0d146267480f3a9dff06603e0fe02=[969197]
#2 14686 tjuricek Merge commit '01caf9661acf4dc7ebf23d33113e4be4ad364ece'

Imported from Git
 Author: Tristan Juricek <[email protected]> 1415915946 -0800
 Committer: Tristan Juricek <[email protected]> 1415915946 -0800
 sha1: 1aaf024362a53435ed87c853fd577049a38eae87
 push-state: complete
 parent-branch: WUpgNvsySG6cferVT-Hvuw==@961945
 parent-changes: c9daabefe02bc3d038f9a3dd4a8c2f1488746a25=[961945]/01caf9661acf4dc7ebf23d33113e4be4ad364ece=[961192]
#1 14682 Git Fusion Git Fusion branch management

Imported from Git
 ghost-of-change-num: 960958
 ghost-of-sha1: 005052ae424bd69f426f7209e741ca1c8c3253c7
 ghost-precedes-sha1: ad052c71a568ef12165e143a6866ad9ceffbb4a1
 parent-branch: None@960958
 push-state: incomplete