Skip to content

Commit 95457b8

Browse files
author
Riccardo Carlesso
committed
fix(appengine): modernize rails-cloudsql gae flex ruby examples
1 parent d1a2aa3 commit 95457b8

5 files changed

Lines changed: 16 additions & 2 deletions

File tree

.toys/kokoro-ci.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,20 @@ def filter_by_ruby_versions
153153
@products.delete "spanner"
154154
# run/rails uses Rails 7 and requires newest Ruby.
155155
@products.delete "run/rails"
156+
# Rails 7 cloud-sql samples require Ruby 3.2+, so run only on newest.
157+
@products.delete "appengine/rails-cloudsql-postgres"
158+
@products.delete "appengine/rails-cloudsql-mysql"
156159
end
157160
if newest_ruby?
158161
# getting-started uses an old Rails and is incompatible with newest.
159162
@products.delete_if { |dir| dir.start_with? "getting-started/" }
160-
# appengine tests are slow and some use an old Rails. Run only on oldest.
161-
@products.delete_if { |dir| dir.start_with? "appengine/" }
163+
# appengine tests are slow and some use an old Rails. Run only on oldest,
164+
# except for rails-cloudsql which require newest Ruby because they use Rails 7.
165+
@products.delete_if do |dir|
166+
dir.start_with?("appengine/") &&
167+
dir != "appengine/rails-cloudsql-postgres" &&
168+
dir != "appengine/rails-cloudsql-mysql"
169+
end
162170
end
163171
end
164172

appengine/rails-cloudsql-mysql/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
source "https://rubygems.org"
16+
ruby ">= 3.2.0"
1617

1718
git_source :github do |repo_name|
1819
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include? "/"

appengine/rails-cloudsql-mysql/app.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
entrypoint: bundle exec rackup --port $PORT
1919
env: flex
2020
runtime: ruby
21+
runtime_config:
22+
operating_system: "ubuntu22"
2123
# [END step_1]
2224

2325
env_variables:

appengine/rails-cloudsql-postgres/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
source "https://rubygems.org"
16+
ruby ">= 3.2.0"
1617

1718
git_source :github do |repo_name|
1819
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include? "/"

appengine/rails-cloudsql-postgres/app.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
entrypoint: bundle exec rackup --port $PORT
1919
env: flex
2020
runtime: ruby
21+
runtime_config:
22+
operating_system: "ubuntu22"
2123
# [END step_1]
2224

2325
env_variables:

0 commit comments

Comments
 (0)