$ 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.
Adding a new Ruby version
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:
NOTE: please ensure that any commands used in ci/templates/src/compile.env.erb are compatible with the newly added Ruby / RubyGems version.
Shared Concourse tasks
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.
ci/tasks/shared/bump-ruby-package
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 from ruby-release that will be vendored into your own BOSH release, e.g. the ruby-X.Y package.
PACKAGE_PREFIX: Optional. Equivalent to passing --prefix to bosh vendor-package. For example, specifying a prefix of myrelease will vendor in the package as myrelease-ruby-X.Y instead of just ruby-X.Y.
PRIVATE_YML: Required. The contents of config/private.yml for your own BOSH release. Necessary to run bosh 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.
ci/tasks/shared/bump-gems
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 a Gemfile to run
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. The package you are using in your own BOSH release (e.g. ruby-X.Y). 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 run bundle cache to vendor in the gems into your repository. Defaults to false.
VENDOR_PATH: Optional. String value that specifies the BUNDLE_CACHE_PATH environment variable to use when vendoring gems. Default to vendor/package.
Compile and Runtime functions and scripts
Included functions in compile.env:
bosh_bundle which runs bundle 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:
Ruby Release
To vendor ruby package into your release, run:
Where RUBY-PACKAGE-VERSION is one of the provided ruby package names The above code will add a ruby package to
your-releaseand introduce aspec.lock.Adding a new Ruby version
Packages for new versions of Ruby can be added by modifying
ci/versions.yml, then reconfiguring the CI pipeline by runningci/configure.sh.The
ci/versions.ymlconfiguration requires that you know the following component versions that correspond with the Ruby version:New versions of RubyGems and libyaml must be added to the
rubygemsandlibyamlstop-level keys respsectively. Then, add the Ruby and component versions, as well as the stemcell to test against, as a new entry under therubieskey. An example config for Ruby 3.3:NOTE: please ensure that any commands used in
ci/templates/src/compile.env.erbare compatible with the newly added Ruby / RubyGems version.Shared Concourse tasks
This repository provides a couple helpful Concourse tasks in
ci/tasks/sharedthat can help keep the Ruby package vendored in your BOSH release up to date, and bump gem versions.ci/tasks/shared/bump-ruby-package
The
bump-ruby-packagetask runsbosh vendor-packageto 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-releasethat will be vendored into your own BOSH release, e.g. theruby-X.Ypackage.PACKAGE_PREFIX: Optional. Equivalent to passing--prefixtobosh vendor-package. For example, specifying a prefix ofmyreleasewill vendor in the package asmyrelease-ruby-X.Yinstead of justruby-X.Y.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-versionfile. When specified, the.ruby-versionfile will be updated with the exact version number (including patch) for the Ruby package.ci/tasks/shared/bump-gems
The
bump-gemstask runsbundle updateon each of your Gemfiles and optionally vendors them into your repository.GEM_DIRS: Required. A space-separated list of directories that contain aGemfileto 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-X.Y). 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 cacheto 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.Compile and Runtime functions and scripts
Included functions in
compile.env:bosh_bundlewhich runsbundle install ...targeted at${BOSH_INSTALL_TARGET}bosh_generate_runtime_envwhich generates${BOSH_INSTALL_TARGET}/bosh/runtime.envTo use
ruby-*package for compilation in your packaging script:To use
ruby-*package at runtime in your job scripts: