diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b251477f8..3e819163b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: - name: Run ShellCheck bin top level run: | shellcheck bin/support/bash_functions.sh bin/support/download_ruby -x && - shellcheck bin/build bin/compile bin/detect bin/release bin/test bin/test-compile -x + shellcheck bin/compile bin/detect bin/release bin/test bin/test-compile -x diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e45aeab8..32d4b2a43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +- Remove experimental CNB support. For official CNB support use [heroku/buildpacks-ruby](https://github.com/heroku/buildpacks-ruby) instead. (https://github.com/heroku/heroku-buildpack-ruby/pull/1464) ## [v271] - 2024-06-03 diff --git a/bin/build b/bin/build deleted file mode 100755 index 5a6d0f4ec..000000000 --- a/bin/build +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -LAYERS_DIR=$1 -PLATFORM_DIR=$2 -_ENV_DIR="$PLATFORM_DIR/env" -PLAN=$3 -APP_DIR=$(pwd) -BIN_DIR=$(cd "$(dirname "$0")" || exit; pwd) # absolute path -BUILDPACK_DIR=$(dirname "$BIN_DIR") - -# legacy buildpack uses $STACK -export STACK=$CNB_STACK_ID - -# shellcheck source=bin/support/bash_functions.sh -source "$BIN_DIR/support/bash_functions.sh" - -cat<&2 - The CNB implementation in this buildpack is no longer maintained - - The heroku/heroku-ruby-buildpack previously implemented the Cloud Native Buildpack \(CNB\) spec beta support, however this functionality is no longer supported or maintained. - - The Heroku Ruby CNB is now at https://github.com/heroku/buildpacks-ruby. See https://github.com/heroku/buildpacks for more information on using the Heroku CNB builder. To avoid interruptions switch to the new CNB as soon as possible. -EOF - -bootstrap_ruby_dir=$(install_bootstrap_ruby "$BIN_DIR" "$BUILDPACK_DIR") -export PATH="$bootstrap_ruby_dir/bin/:$PATH" -unset GEM_PATH - -"$bootstrap_ruby_dir"/bin/ruby "$BIN_DIR/support/ruby_build" "$APP_DIR" "$LAYERS_DIR" "$PLATFORM_DIR" "$PLAN" diff --git a/bin/detect b/bin/detect index 83ad9437c..e25db8c44 100755 --- a/bin/detect +++ b/bin/detect @@ -1,18 +1,10 @@ #!/bin/sh -if [ -z "$CNB_STACK_ID" ]; then - # v2 API - APP_DIR=$1 -else - _PLATFORM_DIR=$1 - _PLAN=$2 - # v3 API - APP_DIR=$(pwd) -fi +APP_DIR=$1 if [ -f "$APP_DIR/Gemfile" ]; then echo "Ruby" exit 0 else - exit 100 + exit 1 fi diff --git a/bin/support/ruby_build b/bin/support/ruby_build deleted file mode 100755 index ddcb77edf..000000000 --- a/bin/support/ruby_build +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby - -# This script compiles an application so it can run on Heroku. -# It will install the application's specified version of Ruby, it's dependencies -# and certain framework specific requirements (such as calling `rake assets:precompile` -# for rails apps). You can see all features described in the devcenter -# https://devcenter.heroku.com/articles/ruby-support -$stdout.sync = true - -$:.unshift File.expand_path("../../../lib", __FILE__) -require "language_pack" -require "language_pack/shell_helpers" - -APP_DIR=ARGV[0] -LAYER_DIR=ARGV[1] -PLATFORM_DIR=ARGV[2] -ENV_DIR="#{PLATFORM_DIR}/env" -PLAN=ARGV[3] - -begin - LanguagePack::ShellHelpers.initialize_env(ENV_DIR) - if pack = LanguagePack.detect(ARGV[0], nil, LAYER_DIR) - pack.topic("Compiling #{pack.name}") - pack.log("compile") do - pack.build - end - end -rescue Exception => e - LanguagePack::ShellHelpers.display_error_and_exit(e) -end - diff --git a/buildpack.toml b/buildpack.toml index 7c72034f4..0bcaf7851 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -1,10 +1,5 @@ -api = "0.2" - [buildpack] -id = "heroku/ruby" -version = "0.1.4" name = "Ruby" -homepage = "https://github.com/heroku/heroku-buildpack-ruby" ruby_version = "3.1.4" [publish] @@ -19,7 +14,6 @@ files = [ "app.json", "hatchet.json", "hatchet.lock", - "package.toml", ] [[publish.Vendor]] @@ -33,16 +27,3 @@ dir = "vendor/ruby/heroku-22" [[publish.Vendor]] url = "https://heroku-buildpack-ruby.s3.us-east-1.amazonaws.com/heroku-24/amd64/ruby-3.1.4.tgz" dir = "vendor/ruby/amd64/heroku-24" - -[[stacks]] -id = "heroku-20" - -[[stacks]] -id = "heroku-22" - -[metadata] - -[metadata.release] - -[metadata.release.docker] -repository = "public.ecr.aws/heroku-buildpacks/heroku-ruby-buildpack" diff --git a/lib/language_pack/base.rb b/lib/language_pack/base.rb index 82187e162..c57ae0324 100644 --- a/lib/language_pack/base.rb +++ b/lib/language_pack/base.rb @@ -5,7 +5,6 @@ require "language_pack/shell_helpers" require "language_pack/cache" require "language_pack/helpers/bundler_cache" -require "language_pack/helpers/layer" require "language_pack/metadata" require "language_pack/fetcher" @@ -28,7 +27,7 @@ class LanguagePack::Base # changes directory to the build_path # @param [String] the path of the build dir # @param [String] the path of the cache dir this is nil during detect and release - def initialize(build_path, cache_path = nil, layer_dir=nil) + def initialize(build_path, cache_path = nil) @build_path = build_path @stack = ENV.fetch("STACK") @cache = LanguagePack::Cache.new(cache_path) @@ -36,7 +35,6 @@ def initialize(build_path, cache_path = nil, layer_dir=nil) @bundler_cache = LanguagePack::BundlerCache.new(@cache, @stack) @id = Digest::SHA1.hexdigest("#{Time.now.to_f}-#{rand(1000000)}")[0..10] @fetchers = {:buildpack => LanguagePack::Fetcher.new(VENDOR_URL) } - @layer_dir = layer_dir @arch = get_arch Dir.chdir build_path @@ -103,24 +101,6 @@ def compile mcount "success" end - def build - write_release_toml - Kernel.puts "" - warnings.each do |warning| - Kernel.puts "\e[1m\e[33m###### WARNING:\e[0m"# Bold yellow - Kernel.puts "" - puts warning - Kernel.puts "" - Kernel.puts "" - end - if deprecations.any? - topic "DEPRECATIONS:" - puts @deprecations.join("\n") - end - Kernel.puts "" - mcount "success" - end - def build_release release = {} release["addons"] = default_addons @@ -130,29 +110,6 @@ def build_release release end - def write_release_toml - release = build_release - - layer = LanguagePack::Helpers::Layer.new(@layer_dir, "env", launch: true) - FileUtils.mkdir_p("#{layer.path}/env.launch") - release["config_vars"].each do |key, value| - File.open("#{layer.path}/env.launch/#{key.upcase}.override", 'w') do |f| - f.write(value) - end - end - - release_toml = release["default_process_types"].map do |type, command| - <