Skip to content
Closed

3.3 #191

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/openshift-tests.yml
Original file line number Diff line number Diff line change
@@ -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.0-ubi9", "3.3-ubi8", "3.3-ubi9", "3.3-ubi10" ]

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.6.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"
22 changes: 3 additions & 19 deletions .s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ..."
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
28 changes: 15 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -127,12 +127,12 @@ 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.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)
Expand Down Expand Up @@ -169,15 +169,15 @@ 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
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)
sassc (2.4.0)
sassc (2.1.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
Expand All @@ -199,8 +199,9 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.4)
strscan (3.0.7)
sqlite3 (2.0.2)
mini_portile2 (~> 2.8.0)
strscan (3.1.0)
thor (1.2.2)
tilt (2.3.0)
timeout (0.4.0)
Expand All @@ -221,7 +222,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.12)
zeitwerk (2.6.13)

PLATFORMS
ruby
Expand All @@ -235,11 +236,12 @@ DEPENDENCIES
listen
matrix
net-smtp
pg (~> 1.2.0)
pg
puma
rails (~> 6)
redis
sass-rails
sassc (~> 2.1, < 2.2)
selenium-webdriver
spring
spring-watcher-listen
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 5 additions & 8 deletions openshift/templates/rails-postgresql-persistent.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@
"secret": "${GITHUB_WEBHOOK_SECRET}"
}
}
],
"postCommit": {
"script": "bundle exec rake test"
}
]
}
},
{
Expand Down Expand Up @@ -180,7 +177,7 @@
"initContainers": [
{
"name": "ruby-init-container",
"image": " ",
"image": "${NAME}:latest",
"command": [
"./migrate-database.sh"
],
Expand Down Expand Up @@ -260,7 +257,7 @@
"containers": [
{
"name": "${NAME}",
"image": " ",
"image": "${NAME}:latest",
"ports": [
{
"containerPort": 8080
Expand Down Expand Up @@ -531,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",
Expand Down
88 changes: 84 additions & 4 deletions openshift/templates/rails-postgresql.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -179,10 +179,90 @@
}
},
"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}",
"image": " ",
"image": "${NAME}:latest",
"ports": [
{
"containerPort": 8080
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions openshift/templates/rails.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@
"spec": {
"containers": [
{
"name": "rails-example",
"image": " ",
"name": "${NAME}",
"image": "${NAME}:latest",
"ports": [
{
"containerPort": 8080
Expand Down
Loading