diff --git a/tools/appliance/README.md b/tools/appliance/README.md index 8c51c9ca756..411fd09a76f 100644 --- a/tools/appliance/README.md +++ b/tools/appliance/README.md @@ -40,12 +40,36 @@ Note, gem may require gcc-4.2, make sure link exists: sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 +# Setting up jenkins (CI) builds + +All the tools listed above are expected to be available. If you follow + + http://rvm.io/integration/jenkins + +then you'll need to do a bit of logic to load RVM in jenkins. In the +build script you put into jenkins, start it with +``` +#!/bin/bash -l +``` + +to ensure a login shell, then add something like +``` +# inspired by https://github.com/CloudBees-community/rubyci-clickstart/blob/master/bin/run-ci +# also see https://rvm.io/integration/jenkins +# .rvmrc won't get trusted/auto-loaded by jenkins by default +export VAGRANT_HOME=$HOME/.vagrant.d-release-cloudstack +rvm use ruby-1.9.3@vagrant-release-cloudstack --create +# do not use --deployment since that requires Gemfile.lock...and we prefer an up-to-date veewee +bundle_args="--path vendor/bundle" +``` + + # How to build SystemVMs automatically Just run build.sh, it will export archived appliances for KVM, XenServer, VMWare and HyperV in `dist`: - sh build.sh [systemvmtemplate|systemvmtemplate64] + bash build.sh [systemvmtemplate|systemvmtemplate64] # Building SystemVM template appliance manually diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index f9c6b75d306..7880a1f58d2 100755 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -97,6 +97,9 @@ if [[ "${VEEWEE_ARGS}" == "" && "${TRACE}" == "1" ]]; then fi VEEWEE_BUILD_ARGS="${VEEWEE_BUILD_ARGS:-${VEEWEE_ARGS} --nogui --auto}" +# any arguments to pass along to the 'bundle install' command +BUNDLE_ARGS="${BUNDLE_ARGS:-}" + # which veewee definition to use appliance="${1:-${appliance:-systemvmtemplate}}" @@ -263,17 +266,7 @@ function create_definition() { } function setup_ruby() { - local bundle_args= - if [[ ! -z "${JENKINS_HOME}" ]]; then - # inspired by https://github.com/CloudBees-community/rubyci-clickstart/blob/master/bin/run-ci - # also see https://rvm.io/integration/jenkins - # .rvmrc won't get trusted/auto-loaded by jenkins by default - export VAGRANT_HOME=$HOME/.vagrant.d-release-cloudstack - rvm use ruby-1.9.3@vagrant-release-cloudstack --create - # do not use --deployment since that requires Gemfile.lock...and we prefer an up-to-date veewee - bundle_args="--path vendor/bundle" - fi - bundle check || bundle install ${bundle_args} + bundle check || bundle install ${BUNDLE_ARGS} } function stop_vbox() {