To vendor ruby package into your release, run:
$ git clone https://github.com/cloudfoundry/bosh-package-ruby-release
$ cd ~/workspace/your-release
$ bosh vendor-package <RUBY-PACKAGE-VERSION> ~/workspace/bosh-package-ruby-release
Where RUBY-PACKAGE-VERSION is one of the provided ruby package names
The above code will add a ruby package to your-release
and introduce a spec.lock
.
Packages for new versions of Ruby can be added by modifying ci/versions.yml
, then reconfiguring the CI pipeline by running ci/configure.sh
.
The ci/versions.yml
configuration requires that you know the following component versions that correspond with the Ruby version:
- The version of RubyGems
- The version of libyaml used by the Psych gem
New versions of RubyGems and libyaml must be added to the rubygems
and libyamls
top-level keys respsectively. Then, add the Ruby and component versions, as well as the stemcell to test against, as a new entry under the rubies
key. An example config for Ruby 3.3:
- version: "3.3"
rubygems: "3.5"
libyaml: "0.2"
stemcell: ubuntu-jammy
This repository provides a couple helpful Concourse tasks in ci/tasks/shared
that can help keep the Ruby package vendored in your BOSH release up to date, and bump gem versions.
The bump-ruby-package
task runs bosh vendor-package
to automatically update the version of Ruby vendored into your own BOSH release.
GIT_USER_EMAIL
: Required. The email that will be used to generate commits.GIT_USER_NAME
: Required. The user name that will be used to generate commits.PACKAGE
: Required. Specifies which package fromruby-release
that will be vendored into your own BOSH release, e.g. theruby-3.2
package.PACKAGE_PREFIX
: Optional. Equivalent to passing--prefix
tobosh vendor-package
. For example, specifying a prefix ofmyrelease
will vendor in the package asmyrelease-ruby-3.2
instead of justruby-3.2
.PRIVATE_YML
: Required. The contents of config/private.yml for your own BOSH release. Necessary to runbosh vendor-package
.RUBY_VERSION_PATH
: Optional. Relative path within your release to the.ruby-version
file. When specified, the.ruby-version
file will be updated with the exact version number (including patch) for the Ruby package.
The bump-gems
task runs bundle update
on each of your Gemfiles and optionally vendors them into your repository.
GEM_DIRS
: Required. A space-separated list of directories that contain aGemfile
to runGIT_USER_EMAIL
: Required. The email that will be used to generate commits.GIT_USER_NAME
: Required. The user name that will be used to generate commits.PACKAGE
: Required. The package you are using in your own BOSH release (e.g.ruby-3.2
). This ensures that the correct version of bundler will be used to make the updates, preventing issues where the version of bundler in your Gemfile.lock does not get out-of-sync with the version used.VENDOR
: Optional. Boolean value that specifies you want to runbundle cache
to vendor in the gems into your repository. Defaults tofalse
.VENDOR_PATH
: Optional. String value that specifies the BUNDLE_CACHE_PATH environment variable to use when vendoring gems. Default tovendor/package
.
Included functions in compile.env
:
bosh_bundle
which runsbundle install ...
targeted at${BOSH_INSTALL_TARGET}
bosh_generate_runtime_env
which generates${BOSH_INSTALL_TARGET}/bosh/runtime.env
To use ruby-*
package for compilation in your packaging script:
#!/bin/bash -eu
source /var/vcap/packages/<RUBY-PACKAGE-VERSION>/bosh/compile.env
...
bosh_bundle
bosh_generate_runtime_env
To use ruby-*
package at runtime in your job scripts:
#!/bin/bash -eu
source /var/vcap/packages/<RUBY-PACKAGE-VERSION>/bosh/runtime.env
source /var/vcap/packages/your-package/bosh/runtime.env
bundle exec ...