diff --git a/README.md b/README.md index 5ae76e33..8a8c4d5e 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ The `bump-ruby-package` task runs `bosh vendor-package` to automatically update * `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-3.2` 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-3.2` instead of just `ruby-3.2`. +* `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. @@ -51,7 +51,7 @@ The `bump-gems` task runs `bundle update` on each of your Gemfiles and optionall * `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-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. +* `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`. diff --git a/ci/versions.yml b/ci/versions.yml index 6cb96013..064efaaf 100644 --- a/ci/versions.yml +++ b/ci/versions.yml @@ -1,10 +1,6 @@ #@data/values --- rubies: -- version: "3.2" - rubygems: "3.4" - libyaml: "0.2" - stemcell: ubuntu-noble - version: "3.3" rubygems: "3.5" libyaml: "0.2" @@ -19,7 +15,6 @@ rubies: stemcell: ubuntu-noble rubygems: -- version: "3.4" - version: "3.5" - version: "3.6" - version: "4.0" diff --git a/config/blobs.yml b/config/blobs.yml index 1b540bb0..cd90ba05 100644 --- a/config/blobs.yml +++ b/config/blobs.yml @@ -1,7 +1,3 @@ -ruby-3.2.10.tar.gz: - size: 19983731 - object_id: e945b71a-ff17-443b-7fdc-965444913d5c - sha: sha256:880acb05e08da8c559c56a13e512bae1b472da67c72ebb750c765f9c2134e689 ruby-3.3.10.tar.gz: size: 22233705 object_id: 1050e99b-4513-42fa-6302-a4f6f28979fa @@ -10,10 +6,6 @@ ruby-3.4.9.tar.gz: size: 22456968 object_id: d31c3384-0b71-4cb5-4e9f-65d521e6b35c sha: sha256:7bb4d4f5e807cc27251d14d9d6086d182c5b25875191e44ab15b709cd7a7dd9c -rubygems-3.4.22.tgz: - size: 1342799 - object_id: f6b8386f-865a-4a11-5bda-acda3d03eb21 - sha: sha256:803fa77776d11d3d1bb563826616c811124425e0331ad1fd983c4144046a6156 rubygems-3.5.23.tgz: size: 960343 object_id: 453d8361-b53c-429f-5361-7d85e118d891 diff --git a/jobs/ruby-3.2-test/monit b/jobs/ruby-3.2-test/monit deleted file mode 100644 index e69de29b..00000000 diff --git a/jobs/ruby-3.2-test/spec b/jobs/ruby-3.2-test/spec deleted file mode 100644 index a2b5f0b9..00000000 --- a/jobs/ruby-3.2-test/spec +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: ruby-3.2-test - -templates: - run: bin/run - -packages: -- ruby-3.2 -- ruby-3.2-test - -properties: {} diff --git a/jobs/ruby-3.2-test/templates/run b/jobs/ruby-3.2-test/templates/run deleted file mode 100644 index f9e03318..00000000 --- a/jobs/ruby-3.2-test/templates/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -eux - -ASSERT_GEM_VERSION=3.4.22 - -echo "Testing runtime compability" - -# shellcheck disable=1091 -source "/var/vcap/packages/ruby-3.2/bosh/runtime.env" -ruby -e 'puts "test"' - -if [ $(ruby -e 'require "yaml"; puts({a: "b\n\n\n"}.to_yaml)' | grep "\.\.\.") ]; then - echo "Found unpatched libyaml" - exit 1 -fi - -echo "Testing compile compability" - -# shellcheck disable=1091 -source "/var/vcap/packages/ruby-3.2-test/bosh/runtime.env" -cd /var/vcap/packages/ruby-3.2-test/ -bundle exec thin start & -sleep 3 -curl http://localhost:3000 | grep test -kill -9 $! - -gems_version=$(bundle exec gem -v) -if [[ $gems_version == *"$ASSERT_GEM_VERSION"* ]]; then - echo "found correct rubygems version $gems_version" -else - echo "wrong rubygems version: $gems_version" - exit 1 -fi diff --git a/packages/ruby-3.2-test/packaging b/packages/ruby-3.2-test/packaging deleted file mode 100644 index 773790a5..00000000 --- a/packages/ruby-3.2-test/packaging +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -eux - -PLATFORM=$(uname | tr '[:upper:]' '[:lower:]') - -# shellcheck disable=1090 -source "${BOSH_PACKAGES_DIR:-/var/vcap/packages}/ruby-3.2/bosh/compile.env" - -if [[ "${PLATFORM}" == "darwin" ]]; then - "${BOSH_PACKAGES_DIR:-/var/vcap/packages}/ruby-3.2/bin/gem" install nokogiri - exit 0 -fi - -cp -r ./test-app/. "${BOSH_INSTALL_TARGET}/" - -cd ${BOSH_INSTALL_TARGET} -bosh_bundle_local -bosh_generate_runtime_env diff --git a/packages/ruby-3.2-test/spec b/packages/ruby-3.2-test/spec deleted file mode 100644 index c3844008..00000000 --- a/packages/ruby-3.2-test/spec +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ruby-3.2-test - -dependencies: -- ruby-3.2 - -files: -- test-app/**/* diff --git a/packages/ruby-3.2/packaging b/packages/ruby-3.2/packaging deleted file mode 100644 index 6877f8da..00000000 --- a/packages/ruby-3.2/packaging +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env bash - -set -e - -RUBY_VERSION=3.2.10 -RUBYGEMS_VERSION=3.4.22 -LIBYAML_VERSION=0.2.5 - -if [ $(uname -s) == "Darwin" ]; then - if brew --prefix openssl; then - brew_prefix_openssl="$(brew --prefix openssl)" - PATH="${brew_prefix_openssl}/bin:$PATH" - with_openssl_dir="--with-openssl-dir=$brew_prefix_openssl" - fi -fi - -# Use Clang if available; the resulting Ruby is faster -if command -v clang &> /dev/null -then - export CC="$(command -v clang)" -fi - -if command -v clang++ &> /dev/null -then - export CXX="$(command -v clang++)" -fi - -openssl_version=$(openssl version) -openssl_major_version=$(echo "${openssl_version}" | cut -f2 -d\ | cut -f1 -d.) -if [ "${openssl_major_version}" == 0 ]; then - echo "OpenSSL version 1 or greater is required." - echo "Currently available: ${openssl_version}" - exit 1 -fi - -tar xzf "yaml-${LIBYAML_VERSION}.tar.gz" -( - set -e - cd "yaml-${LIBYAML_VERSION}" - - patch -p1 < ../patches/libyaml-0.2.5.patch - - if [ "$(uname -m)" == "ppc64le" ]; then - cp "${BOSH_COMPILE_TARGET}"/config/config.{guess,sub} ./tool - fi - - ./configure --prefix="${BOSH_INSTALL_TARGET}" - make - make install -) - -tar xzf "ruby-${RUBY_VERSION}.tar.gz" -( - set -e - cd "ruby-${RUBY_VERSION}" - - if [ "$(uname -m)" == "ppc64le" ]; then - cp "${BOSH_COMPILE_TARGET}"/config/config.{guess,sub} ./tool - fi - - LDFLAGS="-Wl,-rpath -Wl,${BOSH_INSTALL_TARGET}" ./configure --prefix="${BOSH_INSTALL_TARGET}" --disable-install-doc --with-opt-dir="${BOSH_INSTALL_TARGET}" --without-gmp $with_openssl_dir - make - make install -) - -mkdir "${BOSH_INSTALL_TARGET}/bosh" -cp gemrc "${BOSH_INSTALL_TARGET}/bosh/gemrc" - -export PACKAGE_NAME="$(basename ${BOSH_INSTALL_TARGET})" -sed "s#\${PACKAGE_NAME}#${PACKAGE_NAME}#" compile-3.2.env > "${BOSH_INSTALL_TARGET}/bosh/compile.env" -sed "s#\${PACKAGE_NAME}#${PACKAGE_NAME}#" runtime-3.2.env > "${BOSH_INSTALL_TARGET}/bosh/runtime.env" - -source "${BOSH_INSTALL_TARGET}/bosh/runtime.env" - -if [ "$(gem --version)" != "${RUBYGEMS_VERSION}" ]; then - echo "Installing rubygems " "${RUBYGEMS_VERSION}" - tar zxvf "rubygems-${RUBYGEMS_VERSION}.tgz" - ( - set -e - cd "rubygems-${RUBYGEMS_VERSION}" - - if ! ruby setup.rb --no-ri --no-rdoc; then - echo "Cannot install rubygems" - exit 1 - fi - ) -fi - -# We need to replace the shebang in the default binstubs generated by rubygems. -# As of rubygems 2.7.6 and ruby 2.4.4 they fixed a vulnerability with regards -# to path traversal and symlinks. The resulting fix uses the real path for the -# shebang which includes a checksum that is not constant across BOSH vms. See -# https://blog.rubygems.org/2018/02/15/2.7.6-released.html for more details. -ruby overwrite_shebang.rb "${BOSH_INSTALL_TARGET}/bin/gem" -ruby overwrite_shebang.rb "${BOSH_INSTALL_TARGET}/bin/bundle" diff --git a/packages/ruby-3.2/spec b/packages/ruby-3.2/spec deleted file mode 100644 index 3e13e380..00000000 --- a/packages/ruby-3.2/spec +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: ruby-3.2 - -files: -- compile-3.2.env -- config/config.guess -- config/config.sub -- gemrc -- overwrite_shebang.rb -- ruby-3.2.10.tar.gz -- rubygems-3.4.22.tgz -- runtime-3.2.env -- yaml-0.2.5.tar.gz -- patches/libyaml-0.2.5.patch diff --git a/packages/ruby-3.2/version b/packages/ruby-3.2/version deleted file mode 100644 index d6bb32f3..00000000 --- a/packages/ruby-3.2/version +++ /dev/null @@ -1 +0,0 @@ -3.2.10 \ No newline at end of file diff --git a/src/compile-3.2.env b/src/compile-3.2.env deleted file mode 100644 index 2a96bd38..00000000 --- a/src/compile-3.2.env +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# shellcheck disable=1090 -source "${BOSH_PACKAGES_DIR:-/var/vcap/packages}/${PACKAGE_NAME}/bosh/runtime.env" - -# Use Clang if available; the resulting Ruby is faster -if command -v clang &> /dev/null -then - export CC="$(command -v clang)" -fi - -if command -v clang++ &> /dev/null -then - export CXX="$(command -v clang++)" -fi - -bosh_bundle() { - bundle config set --local no_prune 'true' - bundle config set --local without 'development test' - bundle config set --local path "${BOSH_INSTALL_TARGET}/gem_home" - - bundle install \ - --binstubs "${BOSH_INSTALL_TARGET}/bin" \ - "$@" -} - -bosh_bundle_local() { - bundle config set --local no_prune 'true' - bundle config set --local without 'development test' - bundle config set --local path "${BOSH_INSTALL_TARGET}/gem_home" - - bundle install \ - --local \ - --binstubs "${BOSH_INSTALL_TARGET}/bin" \ - "$@" -} - -bosh_generate_runtime_env() { - mkdir -p "${BOSH_INSTALL_TARGET}/bosh" - cat > "${BOSH_INSTALL_TARGET}/bosh/runtime.env" <