From 967d40554d6fe83ce54b3105eb3b2c4d0de01abf Mon Sep 17 00:00:00 2001 From: Stella Yang Date: Fri, 19 Jul 2024 15:29:54 -0700 Subject: [PATCH 1/5] configure process to complain about unset variable --- buildpacks/ruby/src/steps/get_default_process.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpacks/ruby/src/steps/get_default_process.rs b/buildpacks/ruby/src/steps/get_default_process.rs index 8683411c..b2dba89e 100644 --- a/buildpacks/ruby/src/steps/get_default_process.rs +++ b/buildpacks/ruby/src/steps/get_default_process.rs @@ -76,7 +76,7 @@ fn default_rack() -> Process { "-c", &[ "bundle exec rackup", - "--port \"$PORT\"", + "--port \"${PORT:?Error: PORT env var is not set!}\"", "--host \"0.0.0.0\"", ] .join(" "), @@ -91,7 +91,7 @@ fn default_rails() -> Process { "-c", &[ "bin/rails server", - "--port \"$PORT\"", + "--port \"${PORT:?Error: PORT env var is not set!}\"", "--environment \"$RAILS_ENV\"", ] .join(" "), From a2a564620539f5b035659ac584067e2fdf910e16 Mon Sep 17 00:00:00 2001 From: Stella Yang Date: Fri, 19 Jul 2024 15:35:17 -0700 Subject: [PATCH 2/5] Update CHANGELOG.md --- buildpacks/ruby/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildpacks/ruby/CHANGELOG.md b/buildpacks/ruby/CHANGELOG.md index 16f49897..0039df4a 100644 --- a/buildpacks/ruby/CHANGELOG.md +++ b/buildpacks/ruby/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- The buildpack now warns the user when environmental variables used in running process is not defined. ([#307](https://github.com/heroku/buildpacks-ruby/pull/307)) + ## [3.0.0] - 2024-05-17 ### Changed From 2886d6899bac759e966f2a862a81cc10ba61071d Mon Sep 17 00:00:00 2001 From: Stella Yang Date: Fri, 19 Jul 2024 15:29:54 -0700 Subject: [PATCH 3/5] configure process to complain about unset variable --- buildpacks/ruby/src/steps/get_default_process.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpacks/ruby/src/steps/get_default_process.rs b/buildpacks/ruby/src/steps/get_default_process.rs index 8683411c..b2dba89e 100644 --- a/buildpacks/ruby/src/steps/get_default_process.rs +++ b/buildpacks/ruby/src/steps/get_default_process.rs @@ -76,7 +76,7 @@ fn default_rack() -> Process { "-c", &[ "bundle exec rackup", - "--port \"$PORT\"", + "--port \"${PORT:?Error: PORT env var is not set!}\"", "--host \"0.0.0.0\"", ] .join(" "), @@ -91,7 +91,7 @@ fn default_rails() -> Process { "-c", &[ "bin/rails server", - "--port \"$PORT\"", + "--port \"${PORT:?Error: PORT env var is not set!}\"", "--environment \"$RAILS_ENV\"", ] .join(" "), From b1bf6f446fc52540917d2526ce6b0d492e9a1674 Mon Sep 17 00:00:00 2001 From: Stella Yang Date: Fri, 19 Jul 2024 15:35:17 -0700 Subject: [PATCH 4/5] Update CHANGELOG.md --- buildpacks/ruby/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildpacks/ruby/CHANGELOG.md b/buildpacks/ruby/CHANGELOG.md index 16f49897..0039df4a 100644 --- a/buildpacks/ruby/CHANGELOG.md +++ b/buildpacks/ruby/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- The buildpack now warns the user when environmental variables used in running process is not defined. ([#307](https://github.com/heroku/buildpacks-ruby/pull/307)) + ## [3.0.0] - 2024-05-17 ### Changed From 55b6d009382a4d42bebd40f7a707f934aa572406 Mon Sep 17 00:00:00 2001 From: Stella Yang <43301578+lilacstella@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:53:01 -0700 Subject: [PATCH 5/5] Update grammar in changelog Co-authored-by: Richard Schneeman --- buildpacks/ruby/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpacks/ruby/CHANGELOG.md b/buildpacks/ruby/CHANGELOG.md index 0039df4a..e7e2aebf 100644 --- a/buildpacks/ruby/CHANGELOG.md +++ b/buildpacks/ruby/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- The buildpack now warns the user when environmental variables used in running process is not defined. ([#307](https://github.com/heroku/buildpacks-ruby/pull/307)) +- The buildpack now warns the user when environmental variables used in running the default process are not defined. ([#307](https://github.com/heroku/buildpacks-ruby/pull/307)) ## [3.0.0] - 2024-05-17