From 901271e4623d52a3d1b9cc0b2665f043729ce395 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 9 Jan 2024 14:55:20 +0100 Subject: [PATCH 01/11] Relax pg gem constraint. --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index dc280d69..f07ec0f4 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6' # Support postgresql as a database for Active Record -gem 'pg', '~> 1.2.0' +gem 'pg' # Support sqlite3 as a database for Active Record gem 'sqlite3' # Support redis as a key-value store for Action Cable diff --git a/Gemfile.lock b/Gemfile.lock index 62d6b7cf..ad0038f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -130,9 +130,9 @@ GEM nokogiri (1.12.5) mini_portile2 (~> 2.6.1) racc (~> 1.4) - pg (1.2.3) + pg (1.5.4) public_suffix (4.0.7) - puma (6.4.0) + puma (6.4.2) nio4r (~> 2.0) racc (1.7.3) rack (2.2.8) @@ -173,7 +173,7 @@ GEM redis-client (>= 0.17.0) redis-client (0.19.1) connection_pool - regexp_parser (2.8.3) + regexp_parser (2.9.0) rubyzip (2.3.2) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) @@ -235,7 +235,7 @@ DEPENDENCIES listen matrix net-smtp - pg (~> 1.2.0) + pg puma rails (~> 6) redis From f07511ccded3c603d8980439b2e5a0809fed4711 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 11 Jan 2024 21:11:52 +0100 Subject: [PATCH 02/11] Sassc: use more strict dependency ~> 2.1 https://github.com/sass/sassc-ruby/issues/146 --- Gemfile | 1 + Gemfile.lock | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index f07ec0f4..c24cf0e4 100644 --- a/Gemfile +++ b/Gemfile @@ -40,6 +40,7 @@ gem 'jbuilder' gem 'listen' gem 'ffi', '>= 1.15.1' +gem "sassc", "~> 2.1", "< 2.2" # ActiveRecord makes use of these bundled gems, as of Ruby 3.1, these requirements # have to be explicitly marked in a Gemfile. diff --git a/Gemfile.lock b/Gemfile.lock index ad0038f0..b69073ab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -81,7 +81,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) connection_pool (2.4.1) crass (1.0.6) digest (3.1.1) @@ -177,7 +177,7 @@ GEM rubyzip (2.3.2) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) - sassc (2.4.0) + sassc (2.1.0) ffi (~> 1.9) sassc-rails (2.1.2) railties (>= 4.0.0) @@ -200,7 +200,7 @@ GEM activesupport (>= 5.2) sprockets (>= 3.0.0) sqlite3 (1.4.4) - strscan (3.0.7) + strscan (3.0.8) thor (1.2.2) tilt (2.3.0) timeout (0.4.0) @@ -240,6 +240,7 @@ DEPENDENCIES rails (~> 6) redis sass-rails + sassc (~> 2.1, < 2.2) selenium-webdriver spring spring-watcher-listen From da83a1bd849ed381920cf2b989f2e340ab9efbfb Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 12 Feb 2024 21:08:32 +0100 Subject: [PATCH 03/11] Modernize assemble file. --- .s2i/bin/assemble | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/.s2i/bin/assemble b/.s2i/bin/assemble index 9b3b3968..3aff70a5 100644 --- a/.s2i/bin/assemble +++ b/.s2i/bin/assemble @@ -8,13 +8,7 @@ echo "---> Building your Ruby application from source ..." if [ -f Gemfile ]; then ADDTL_BUNDLE_ARGS="--retry 2" if [ -f Gemfile.lock ]; then - # This is new in version 3.0 - # [DEPRECATED] The `--deployment` flag is deprecated because it relies - # on being remembered across bundler invocations, - # which bundler will no longer do in future versions. - # Instead please use `bundle config set --local deployment 'true'`, - # and stop using this flag - bundle config --local deployment 'true' + bundle config set --local deployment 'true' fi if [[ "$RAILS_ENV" == "development" || "$RACK_ENV" == "development" ]]; then @@ -26,21 +20,11 @@ if [ -f Gemfile ]; then fi if [ -n "$BUNDLE_WITHOUT" ]; then - # [DEPRECATED] The `--without` flag is deprecated because - # it relies on being remembered across bundler invocations, - # which bundler will no longer do in future versions. - # Instead please use `bundle config set --local without ''test''`, - # and stop using this flag - bundle config --local without "$BUNDLE_WITHOUT" + bundle config set --local without "$BUNDLE_WITHOUT" fi echo "---> Running 'bundle install ${ADDTL_BUNDLE_ARGS}' ..." - # [DEPRECATED] The `--path` flag is deprecated because - # it relies on being remembered across bundler invocations, - # which bundler will no longer do in future versions. - # Instead please use `bundle config set --local path './bundle'`, - # and stop using this flag - bundle config --local path './bundle' + bundle config set --local path './bundle' bundle install ${ADDTL_BUNDLE_ARGS} echo "---> Cleaning up unused ruby gems ..." From a1d5825181c72c3c218364b7438b8534dbe571d6 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 12 Feb 2024 22:28:00 +0100 Subject: [PATCH 04/11] Refresh Gemfile.lock dependencies. --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b69073ab..33251921 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -169,7 +169,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - redis (5.0.8) + redis (5.1.0) redis-client (>= 0.17.0) redis-client (0.19.1) connection_pool @@ -200,7 +200,7 @@ GEM activesupport (>= 5.2) sprockets (>= 3.0.0) sqlite3 (1.4.4) - strscan (3.0.8) + strscan (3.1.0) thor (1.2.2) tilt (2.3.0) timeout (0.4.0) @@ -221,7 +221,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.12) + zeitwerk (2.6.13) PLATFORMS ruby From ccd98fddad88edcbdb97ab32dbb78180e670993a Mon Sep 17 00:00:00 2001 From: Ales Nezbeda Date: Wed, 10 Jul 2024 10:59:15 +0200 Subject: [PATCH 05/11] Update SQLite to fix compilation on Fedora (#173) Due to change in Fedora [0] that turns on more errors and/or turns some warnings into errors, sqlite3 1.4.4 stopped compiling successfully on Fedora >= 40. Bumping the sqlite3 gem version fixes that. Since 3.3 branch is only relevant for Ruby >= 3.3 we don't have to worry about keeping compatibility with earlier Rubies (like 2.5 on RHEL 8). It was fixed by sqlite3 upstream in a commit [1] first present in sqlite3 1.5.0. [0] https://fedoraproject.org/wiki/Changes/PortingToModernC [1] https://github.com/sparklemotion/sqlite3-ruby/commit/abdbfd5f5d2feb5ec280811b10c8fc0dc14a6729 --- Gemfile.lock | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 33251921..49b39f5a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -111,7 +111,7 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) - mini_portile2 (2.6.1) + mini_portile2 (2.8.7) minitest (5.15.0) net-imap (0.2.2) digest @@ -127,8 +127,8 @@ GEM net-protocol timeout nio4r (2.7.0) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.16.6) + mini_portile2 (~> 2.8.2) racc (~> 1.4) pg (1.5.4) public_suffix (4.0.7) @@ -199,7 +199,8 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.4.4) + sqlite3 (2.0.2) + mini_portile2 (~> 2.8.0) strscan (3.1.0) thor (1.2.2) tilt (2.3.0) From 8b423c256ba6afc2026767a807323d38789c1e0b Mon Sep 17 00:00:00 2001 From: Petr Hracek Date: Mon, 22 Jul 2024 11:11:30 +0200 Subject: [PATCH 06/11] remove racke test --- openshift/templates/rails-postgresql-persistent.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openshift/templates/rails-postgresql-persistent.json b/openshift/templates/rails-postgresql-persistent.json index 55604fa7..812066b2 100644 --- a/openshift/templates/rails-postgresql-persistent.json +++ b/openshift/templates/rails-postgresql-persistent.json @@ -142,10 +142,7 @@ "secret": "${GITHUB_WEBHOOK_SECRET}" } } - ], - "postCommit": { - "script": "bundle exec rake test" - } + ] } }, { From ba8bd3bd1514bfa58f5fce340a4b8a47e1806377 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Mon, 23 Sep 2024 08:28:29 +0200 Subject: [PATCH 07/11] Fix templates for branch '3.3'. Image is not defined and it caused ImgErrorPullBackOff Signed-off-by: Petr "Stone" Hracek --- openshift/templates/rails-postgresql-persistent.json | 2 +- openshift/templates/rails-postgresql.json | 2 +- openshift/templates/rails.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openshift/templates/rails-postgresql-persistent.json b/openshift/templates/rails-postgresql-persistent.json index 812066b2..9b47b099 100644 --- a/openshift/templates/rails-postgresql-persistent.json +++ b/openshift/templates/rails-postgresql-persistent.json @@ -257,7 +257,7 @@ "containers": [ { "name": "${NAME}", - "image": " ", + "image": "${NAME}:latest", "ports": [ { "containerPort": 8080 diff --git a/openshift/templates/rails-postgresql.json b/openshift/templates/rails-postgresql.json index b178b551..e17ca919 100644 --- a/openshift/templates/rails-postgresql.json +++ b/openshift/templates/rails-postgresql.json @@ -182,7 +182,7 @@ "containers": [ { "name": "${NAME}", - "image": " ", + "image": "${NAME}:latest", "ports": [ { "containerPort": 8080 diff --git a/openshift/templates/rails.json b/openshift/templates/rails.json index a29a4399..c2fc3083 100644 --- a/openshift/templates/rails.json +++ b/openshift/templates/rails.json @@ -156,7 +156,7 @@ "containers": [ { "name": "rails-example", - "image": " ", + "image": "${NAME}:latest", "ports": [ { "containerPort": 8080 From e08ff794f87504767acc65434f9d17a1a22ce12c Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Tue, 24 Sep 2024 12:19:15 +0200 Subject: [PATCH 08/11] Use 3.3-ubi9 as default. Add initialConter to rail-postgresql.json Signed-off-by: Petr "Stone" Hracek --- .../rails-postgresql-persistent.json | 4 +- openshift/templates/rails-postgresql.json | 86 ++++++++++++++++++- 2 files changed, 85 insertions(+), 5 deletions(-) diff --git a/openshift/templates/rails-postgresql-persistent.json b/openshift/templates/rails-postgresql-persistent.json index 9b47b099..5284995b 100644 --- a/openshift/templates/rails-postgresql-persistent.json +++ b/openshift/templates/rails-postgresql-persistent.json @@ -528,9 +528,9 @@ { "name": "RUBY_VERSION", "displayName": "Ruby Version", - "description": "Version of Ruby image to be used (3.0-ubi8 by default).", + "description": "Version of Ruby image to be used (3.3-ubi9 by default).", "required": true, - "value": "3.0-ubi8" + "value": "3.3-ubi9" }, { "name": "POSTGRESQL_VERSION", diff --git a/openshift/templates/rails-postgresql.json b/openshift/templates/rails-postgresql.json index e17ca919..912c010a 100644 --- a/openshift/templates/rails-postgresql.json +++ b/openshift/templates/rails-postgresql.json @@ -147,7 +147,7 @@ "annotations": { "description": "Defines how to deploy the application server", "template.alpha.openshift.io/wait-for-ready": "true", - "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"}]" + "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.containers[0].image\"},{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${NAME}:latest\"},\"fieldPath\": \"spec.template.spec.initContainers[0].image\"}]" } }, "spec": { @@ -179,6 +179,86 @@ } }, "spec": { + "initContainers": [ + { + "name": "ruby-init-container", + "image": " ", + "command": [ + "./migrate-database.sh" + ], + "env": [ + { + "name": "DATABASE_SERVICE_NAME", + "value": "${DATABASE_SERVICE_NAME}" + }, + { + "name": "POSTGRESQL_USER", + "valueFrom": { + "secretKeyRef": { + "name": "${NAME}", + "key": "database-user" + } + } + }, + { + "name": "POSTGRESQL_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "name": "${NAME}", + "key": "database-password" + } + } + }, + { + "name": "SECRET_KEY_BASE", + "valueFrom": { + "secretKeyRef": { + "name": "${NAME}", + "key": "keybase" + } + } + }, + { + "name": "POSTGRESQL_DATABASE", + "value": "${DATABASE_NAME}" + }, + { + "name": "POSTGRESQL_MAX_CONNECTIONS", + "value": "${POSTGRESQL_MAX_CONNECTIONS}" + }, + { + "name": "POSTGRESQL_SHARED_BUFFERS", + "value": "${POSTGRESQL_SHARED_BUFFERS}" + }, + { + "name": "APPLICATION_DOMAIN", + "value": "${APPLICATION_DOMAIN}" + }, + { + "name": "APPLICATION_USER", + "valueFrom": { + "secretKeyRef": { + "name": "${NAME}", + "key": "application-user" + } + } + }, + { + "name": "APPLICATION_PASSWORD", + "valueFrom": { + "secretKeyRef": { + "name": "${NAME}", + "key": "application-password" + } + } + }, + { + "name": "RAILS_ENV", + "value": "${RAILS_ENV}" + } + ] + } + ], "containers": [ { "name": "${NAME}", @@ -434,9 +514,9 @@ { "name": "RUBY_VERSION", "displayName": "Ruby Version", - "description": "Version of Ruby image to be used (3.0-ubi8 by default).", + "description": "Version of Ruby image to be used (3.3-ubi9 by default).", "required": true, - "value": "3.0-ubi8" + "value": "3.3-ubi9" }, { "name": "MEMORY_LIMIT", From eded5b50e429c50354501b9286fb5578a94ec259 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Tue, 24 Sep 2024 12:54:39 +0200 Subject: [PATCH 09/11] Add Makefile and test suite Signed-off-by: Petr "Stone" Hracek --- .github/workflows/openshift-tests.yml | 30 +++++++++++ Makefile | 3 ++ tests/test_rails.py | 58 +++++++++++++++++++++ tests/test_rails_postgresql.py | 72 +++++++++++++++++++++++++++ 4 files changed, 163 insertions(+) create mode 100644 .github/workflows/openshift-tests.yml create mode 100644 Makefile create mode 100644 tests/test_rails.py create mode 100644 tests/test_rails_postgresql.py diff --git a/.github/workflows/openshift-tests.yml b/.github/workflows/openshift-tests.yml new file mode 100644 index 00000000..6e47e950 --- /dev/null +++ b/.github/workflows/openshift-tests.yml @@ -0,0 +1,30 @@ +on: + issue_comment: + types: + - created +jobs: + openshift-tests: + # This job only runs for '[test] pull request comments by owner, member + name: "RHEL9 tests: imagestream ${{ matrix.version }}" + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + version: [ "2.5-ubi8", "3.1-ubi8", "3.0-ubi9", "3.1-ubi9", "3.3-ubi8", "3.3-ubi9" ] + + if: | + github.event.issue.pull_request + && contains(github.event.comment.body, '[test]') + && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) + steps: + - uses: sclorg/testing-farm-as-github-action@main + with: + api_key: ${{ secrets.TF_INTERNAL_API_KEY }} + compose: "RHEL-9.4.0-Nightly" + git_url: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans" + git_ref: "master" + tf_scope: "private" + tmt_plan_regex: "rhel9-openshift-pytest" + update_pull_request_status: true + pull_request_status_name: "RHEL9-OpenShift-4 - imagestream test ${{ matrix.version }}" + variables: "REPO_URL=${{ github.server_url }}/${{ github.repository }};REPO_NAME=${{ github.repository }};PR_NUMBER=${{ github.event.issue.number }};OS=rhel9;SINGLE_VERSION=${{ matrix.version }};TEST_NAME=test-openshift-pytest" \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..d7bdebcb --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +.PHONY: test-openshift-pytest +test-openshift-pytest: + cd tests && PYTHONPATH=$(CURDIR) python3.12 -m pytest -s -rA --showlocals -vv test_*.py diff --git a/tests/test_rails.py b/tests/test_rails.py new file mode 100644 index 00000000..00bb37f3 --- /dev/null +++ b/tests/test_rails.py @@ -0,0 +1,58 @@ +import os + +import pytest + +from pathlib import Path + +from container_ci_suite.openshift import OpenShiftAPI + +test_dir = Path(os.path.abspath(os.path.dirname(__file__))) + +VERSION = os.getenv("SINGLE_VERSION") +if not VERSION: + VERSION = "3.1-ubi8" + + +class TestRailsAppExTemplate: + + def setup_method(self): + self.oc_api = OpenShiftAPI(pod_name_prefix="rails-example") + json_raw_file = self.oc_api.get_raw_url_for_json( + container="s2i-ruby-container", dir="imagestreams", filename="ruby-rhel.json" + ) + self.oc_api.import_is(path=json_raw_file, name="ruby") + + def teardown_method(self): + self.oc_api.delete_project() + + def test_template_inside_cluster(self): + if VERSION.startswith("3.3"): + branch_to_test = "3.3" + else: + branch_to_test = "master" + expected_output = "Welcome to your Rails application" + template_json = test_dir / "../openshift/templates" / "rails.json" + assert self.oc_api.deploy_template( + template=str(template_json), name_in_template="rails-example", expected_output=expected_output, + openshift_args=[f"SOURCE_REPOSITORY_REF={branch_to_test}", f"RUBY_VERSION={VERSION}", "NAME=rails-example"] + ) + assert self.oc_api.template_deployed(name_in_template="rails-example") + assert self.oc_api.check_response_inside_cluster( + name_in_template="rails-example", expected_output=expected_output + ) + + def test_template_by_request(self): + if VERSION.startswith("3.3"): + branch_to_test = "3.3" + else: + branch_to_test = "master" + expected_output = "Welcome to your Rails application" + template_json = test_dir / "../openshift/templates" / "rails.json" + assert self.oc_api.deploy_template( + template=str(template_json), name_in_template="rails-example", expected_output=expected_output, + openshift_args=[f"SOURCE_REPOSITORY_REF={branch_to_test}", f"RUBY_VERSION={VERSION}", "NAME=rails-example"] + ) + assert self.oc_api.template_deployed(name_in_template="rails-example") + assert self.oc_api.check_response_outside_cluster( + name_in_template="rails-example", expected_output=expected_output + ) diff --git a/tests/test_rails_postgresql.py b/tests/test_rails_postgresql.py new file mode 100644 index 00000000..895cbbea --- /dev/null +++ b/tests/test_rails_postgresql.py @@ -0,0 +1,72 @@ +import os + +import pytest + +from pathlib import Path + +from container_ci_suite.openshift import OpenShiftAPI + +test_dir = Path(os.path.abspath(os.path.dirname(__file__))) + +VERSION = os.getenv("SINGLE_VERSION") +if not VERSION: + VERSION = "3.1-ubi8" + + +class TestRailsAppWithPostgreSQLExTemplate: + + def setup_method(self): + self.oc_api = OpenShiftAPI(pod_name_prefix="rails-example") + json_raw_file = self.oc_api.get_raw_url_for_json( + container="s2i-ruby-container", dir="imagestreams", filename="ruby-rhel.json" + ) + self.oc_api.import_is(path=json_raw_file, name="ruby") + json_raw_file = self.oc_api.get_raw_url_for_json( + container="postgresql-container", dir="imagestreams", filename="postgresql-rhel.json" + ) + self.oc_api.import_is(path=json_raw_file, name="postgresql") + + def teardown_method(self): + self.oc_api.delete_project() + + def test_template_inside_cluster(self): + if VERSION.startswith("3.3"): + branch_to_test = "3.3" + else: + branch_to_test = "master" + expected_output = "Welcome to your Rails application" + template_json = test_dir / "../openshift/templates" / "rails-postgresql-persistent.json" + assert self.oc_api.deploy_template( + template=str(template_json), name_in_template="rails-example", expected_output=expected_output, + openshift_args=[ + f"SOURCE_REPOSITORY_REF={branch_to_test}", + f"RUBY_VERSION={VERSION}", + "NAME=rails-example", + "POSTGRESQL_VERSION=12-el8" + ] + ) + assert self.oc_api.template_deployed(name_in_template="rails-example") + assert self.oc_api.check_response_inside_cluster( + name_in_template="rails-example", expected_output=expected_output + ) + + def test_template_by_request(self): + if VERSION.startswith("3.3"): + branch_to_test = "3.3" + else: + branch_to_test = "master" + expected_output = "Welcome to your Rails application" + template_json = test_dir / "../openshift/templates" / "rails-postgresql-persistent.json" + assert self.oc_api.deploy_template( + template=str(template_json), name_in_template="rails-example", expected_output=expected_output, + openshift_args=[ + f"SOURCE_REPOSITORY_REF={branch_to_test}", + f"RUBY_VERSION={VERSION}", + "NAME=rails-example", + "POSTGRESQL_VERSION=12-el8" + ] + ) + assert self.oc_api.template_deployed(name_in_template="rails-example") + assert self.oc_api.check_response_outside_cluster( + name_in_template="rails-example", expected_output=expected_output + ) From b77358fdd6b2659533da9ca9364670fa96f2608d Mon Sep 17 00:00:00 2001 From: pkhartsk Date: Tue, 10 Mar 2026 12:40:49 +0100 Subject: [PATCH 10/11] Update gemfiles to work with 4.0 (#186) Added unbundled default gems, updated existing ones, fixed versions for gems updating which causes issues --- Gemfile | 14 ++++++++++++-- Gemfile.lock | 27 +++++++++++++++++++++------ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index c24cf0e4..18a509c7 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,16 @@ git_source(:github) do |repo_name| "https://github.com/#{repo_name}.git" end - +# 4.0 made these non-default +gem 'logger' +gem 'bigdecimal' +gem 'ostruct' +gem 'tsort' +gem 'mutex_m' +gem 'benchmark' +gem 'base64' +# Rubyzip 3.0 will introduce breaking changes, pin it +gem 'rubyzip', '~> 2.3.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6' # Support postgresql as a database for Active Record @@ -18,6 +27,8 @@ gem 'redis' gem 'puma' # Use SCSS for stylesheets gem 'sass-rails' +# To prevent https://github.com/sass/sassc-ruby/issues/146 +gem "sassc", "~> 2.1", "< 2.2" # Use Uglifier as compressor for JavaScript assets gem 'uglifier' # See https://github.com/rails/execjs#readme for more supported runtimes @@ -40,7 +51,6 @@ gem 'jbuilder' gem 'listen' gem 'ffi', '>= 1.15.1' -gem "sassc", "~> 2.1", "< 2.2" # ActiveRecord makes use of these bundled gems, as of Ruby 3.1, these requirements # have to be explicitly marked in a Gemfile. diff --git a/Gemfile.lock b/Gemfile.lock index 49b39f5a..dbec7b09 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,6 +62,9 @@ GEM zeitwerk (~> 2.3) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.0.1) bindex (0.8.1) builder (3.2.4) byebug (11.1.3) @@ -81,7 +84,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) digest (3.1.1) @@ -99,6 +102,7 @@ GEM listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -111,8 +115,9 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) - mini_portile2 (2.8.7) - minitest (5.15.0) + mini_portile2 (2.8.9) + minitest (5.26.2) + mutex_m (0.3.0) net-imap (0.2.2) digest net-protocol @@ -127,14 +132,15 @@ GEM net-protocol timeout nio4r (2.7.0) - nokogiri (1.16.6) + nokogiri (1.19.1) mini_portile2 (~> 2.8.2) racc (~> 1.4) - pg (1.5.4) + ostruct (0.6.3) + pg (1.6.3) public_suffix (4.0.7) puma (6.4.2) nio4r (~> 2.0) - racc (1.7.3) + racc (1.8.1) rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) @@ -205,6 +211,7 @@ GEM thor (1.2.2) tilt (2.3.0) timeout (0.4.0) + tsort (0.2.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -228,24 +235,32 @@ PLATFORMS ruby DEPENDENCIES + base64 + benchmark + bigdecimal byebug capybara coffee-rails ffi (>= 1.15.1) jbuilder listen + logger matrix + mutex_m net-smtp + ostruct pg puma rails (~> 6) redis + rubyzip (~> 2.3.0) sass-rails sassc (~> 2.1, < 2.2) selenium-webdriver spring spring-watcher-listen sqlite3 + tsort turbolinks tzinfo-data uglifier From 551b2c394e6dce2fad494cf908b4cad07a58cf30 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Mon, 27 Apr 2026 09:56:11 +0200 Subject: [PATCH 11/11] Fix rails-postgresql-persistent.json Use image definitions as "image": "{NAME}:latest" Signed-off-by: Petr "Stone" Hracek --- openshift/templates/rails-postgresql-persistent.json | 4 ++-- openshift/templates/rails-postgresql.json | 2 +- openshift/templates/rails.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openshift/templates/rails-postgresql-persistent.json b/openshift/templates/rails-postgresql-persistent.json index 5284995b..d4205319 100644 --- a/openshift/templates/rails-postgresql-persistent.json +++ b/openshift/templates/rails-postgresql-persistent.json @@ -177,7 +177,7 @@ "initContainers": [ { "name": "ruby-init-container", - "image": " ", + "image": "${NAME}:latest", "command": [ "./migrate-database.sh" ], @@ -440,7 +440,7 @@ "containers": [ { "name": "postgresql", - "image": " ", + "image": "postgresql:${POSTGRESQL_VERSION}", "ports": [ { "containerPort": 5432 diff --git a/openshift/templates/rails-postgresql.json b/openshift/templates/rails-postgresql.json index 912c010a..0dbb99c2 100644 --- a/openshift/templates/rails-postgresql.json +++ b/openshift/templates/rails-postgresql.json @@ -182,7 +182,7 @@ "initContainers": [ { "name": "ruby-init-container", - "image": " ", + "image": "${NAME}:latest", "command": [ "./migrate-database.sh" ], diff --git a/openshift/templates/rails.json b/openshift/templates/rails.json index c2fc3083..95bbd64f 100644 --- a/openshift/templates/rails.json +++ b/openshift/templates/rails.json @@ -155,7 +155,7 @@ "spec": { "containers": [ { - "name": "rails-example", + "name": "${NAME}", "image": "${NAME}:latest", "ports": [ {