From 173c5cf8cd617d078fe8bc9f0f252225ca2c9bf5 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Tue, 19 Dec 2023 10:48:58 +0100 Subject: [PATCH 01/13] Add github build workflow --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..462676e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: build + +on: + push: + branches: + - 'main' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: user/app:latest \ No newline at end of file From 6ca114379c18dacf8c5fb0d4f5bca9d0f32d58d4 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Tue, 19 Dec 2023 10:49:59 +0100 Subject: [PATCH 02/13] Switch to current branch for workflow testing --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 462676e..dae07c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: build on: push: branches: - - 'main' + - 'github_build_workflow' jobs: docker: From 4c3b281ee5156461dfca962d6cd164fb57275f88 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Tue, 19 Dec 2023 11:00:42 +0100 Subject: [PATCH 03/13] Update workflow to use robot account and tag properly --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dae07c5..cb6599a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,14 +16,15 @@ jobs: name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub + name: Login to Puzzle Registry uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: registry.puzzle.ch + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_ROBOT_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 with: push: true - tags: user/app:latest \ No newline at end of file + tags: statuscope:latest \ No newline at end of file From 64d9b84b2cb4441f0e6a6601fc2c80b4e535c91e Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Tue, 19 Dec 2023 11:02:34 +0100 Subject: [PATCH 04/13] Use correct registry scoped workspace --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb6599a..c442ae1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,4 +27,4 @@ jobs: uses: docker/build-push-action@v5 with: push: true - tags: statuscope:latest \ No newline at end of file + tags: registry.puzzle.ch/ruby_ops/statuscope:latest \ No newline at end of file From da9b913d48d907074f5c629032a4a41522518577 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Tue, 19 Dec 2023 12:35:45 +0100 Subject: [PATCH 05/13] Update all the things --- .ruby-version | 2 +- Dockerfile | 4 +- Gemfile | 2 +- Gemfile.lock | 296 +++++++++++++++++++++++++++++--------------------- db/schema.rb | 22 ++-- 5 files changed, 185 insertions(+), 141 deletions(-) diff --git a/.ruby-version b/.ruby-version index 80d02f9..9e79f6c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.5.5 +ruby-3.2.2 diff --git a/Dockerfile b/Dockerfile index 5e3b5d1..5f952fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Build Stage # ################################# -FROM ruby:3.0 AS build +FROM ruby:3.2 AS build # Set build shell SHELL ["/bin/bash", "-c"] @@ -65,7 +65,7 @@ RUN rm -rf vendor/cache/ .git spec/ node_modules/ tmp/ \ ################################# # This image will be replaced by Openshift -FROM ruby:3.0-slim AS app +FROM ruby:3.2-slim AS app # Set runtime shell SHELL ["/bin/bash", "-c"] diff --git a/Gemfile b/Gemfile index 32e0b9d..96b1659 100644 --- a/Gemfile +++ b/Gemfile @@ -23,5 +23,5 @@ group :development, :test do end group :development do - gem 'listen', '>= 3.0.5', '< 3.2' + gem 'listen' end diff --git a/Gemfile.lock b/Gemfile.lock index 22b4fe4..07e612f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,116 +1,142 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + actioncable (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + zeitwerk (~> 2.6) + actionmailbox (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4) - actionpack (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activesupport (= 7.0.4) + actionmailer (7.1.2) + actionpack (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activesupport (= 7.1.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) + rails-dom-testing (~> 2.2) + actionpack (7.1.2) + actionview (= 7.1.2) + activesupport (= 7.1.2) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.2) + actionpack (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) + actionview (7.1.2) + activesupport (= 7.1.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4) - activesupport (= 7.0.4) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.2) + activesupport (= 7.1.2) globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) + activemodel (7.1.2) + activesupport (= 7.1.2) + activerecord (7.1.2) + activemodel (= 7.1.2) + activesupport (= 7.1.2) + timeout (>= 0.4.0) + activestorage (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activesupport (= 7.1.2) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4) + activesupport (7.1.2) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) ast (2.4.2) - bootsnap (1.13.0) + base64 (0.2.0) + bigdecimal (3.1.5) + bootsnap (1.17.0) msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) coderay (1.1.3) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) + date (3.3.4) diff-lcs (1.5.0) - erubi (1.11.0) - fabrication (2.30.0) - ffi (1.15.5) - globalid (1.0.1) - activesupport (>= 5.0) - i18n (1.12.0) + drb (2.2.0) + ruby2_keywords + erubi (1.12.0) + fabrication (2.31.0) + ffi (1.16.3) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.6.2) - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - loofah (2.21.3) + io-console (0.7.1) + irb (1.10.1) + rdoc + reline (>= 0.3.8) + json (2.7.1) + language_server-protocol (3.17.0.3) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.7.1) + mail (2.8.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp marcel (1.0.2) method_source (1.0.0) - mini_mime (1.1.2) - minitest (5.17.0) - msgpack (1.6.0) - net-imap (0.3.1) + mini_mime (1.1.5) + minitest (5.20.0) + msgpack (1.7.2) + mutex_m (0.2.0) + net-imap (0.4.8) + date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.1.3) + net-protocol (0.2.2) timeout - net-smtp (0.3.2) + net-smtp (0.4.0) net-protocol - nio4r (2.5.8) - nokogiri (1.15.0-x86_64-linux) + nio4r (2.7.0) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.1.2.1) + parallel (1.24.0) + parser (3.2.2.4) ast (~> 2.4.1) - pry (0.14.1) + racc + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) pry-byebug (3.10.1) @@ -118,85 +144,103 @@ GEM pry (>= 0.13, < 0.15) pry-rails (0.3.9) pry (>= 0.10.4) + psych (5.1.2) + stringio puma (4.3.12) nio4r (~> 2.0) - racc (1.6.2) - rack (2.2.7) - rack-test (2.0.2) + racc (1.7.3) + rack (3.0.8) + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.2) + actioncable (= 7.1.2) + actionmailbox (= 7.1.2) + actionmailer (= 7.1.2) + actionpack (= 7.1.2) + actiontext (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activemodel (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) bundler (>= 1.15.0) - railties (= 7.0.4) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 7.1.2) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - method_source + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) + rake (13.1.0) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - regexp_parser (2.6.0) - rexml (3.2.5) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.1) + rdoc (6.6.2) + psych (>= 4.0.0) + regexp_parser (2.8.3) + reline (0.4.1) + io-console (~> 0.5) + rexml (3.2.6) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-rails (6.0.0) + rspec-support (~> 3.12.0) + rspec-rails (6.1.0) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) - rspec-support (3.11.1) - rubocop (1.36.0) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.12.1) + rubocop (1.59.0) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.20.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.21.0) - parser (>= 3.1.1.0) - ruby-progressbar (1.11.0) - sqlite3 (1.5.3-x86_64-linux) - thor (1.2.1) - timeout (0.3.0) - tzinfo (2.0.5) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sqlite3 (1.6.9-x86_64-linux) + stringio (3.1.0) + thor (1.3.0) + timeout (0.4.1) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) - websocket-driver (0.7.5) + unicode-display_width (2.5.0) + webrick (1.8.1) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.1) + zeitwerk (2.6.12) PLATFORMS x86_64-linux @@ -204,7 +248,7 @@ PLATFORMS DEPENDENCIES bootsnap (>= 1.1.0) fabrication - listen (>= 3.0.5, < 3.2) + listen pry-byebug pry-rails puma (~> 4.3) diff --git a/db/schema.rb b/db/schema.rb index 41c75f7..ad18c05 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,26 +2,26 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_12_03_112953) do - +ActiveRecord::Schema[7.1].define(version: 2020_12_03_112953) do create_table "heartbeats", force: :cascade do |t| t.string "application" t.string "token" t.integer "interval_seconds" - t.datetime "last_signal_at" + t.datetime "last_signal_at", precision: nil t.boolean "last_signal_ok" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "team" - t.index ["application", "token"], name: "index_heartbeats_on_application_and_token", unique: true + t.index ["application"], name: "index_heartbeats_on_application", unique: true + t.index ["token"], name: "index_heartbeats_on_token", unique: true end end From 8646759ccc0db271741f5049fabaf70cfe4266c1 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Thu, 21 Dec 2023 10:00:52 +0100 Subject: [PATCH 06/13] Update gems and bundler --- Dockerfile | 2 +- Gemfile | 4 +--- Gemfile.lock | 12 ++++-------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5f952fc..1295459 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ SHELL ["/bin/bash", "-c"] # Use root user USER root -ARG BUNDLER_VERSION=2.3.23 +ARG BUNDLER_VERSION=2.5.1 ARG PRE_INSTALL_SCRIPT ARG BUILD_PACKAGES="sqlite3 libsqlite3-dev build-essential" diff --git a/Gemfile b/Gemfile index 96b1659..12f9c9e 100644 --- a/Gemfile +++ b/Gemfile @@ -6,12 +6,10 @@ gem 'rails' gem 'sqlite3' # database -gem 'puma', '~> 4.3' # app server +gem 'puma' # app server # gem 'jbuilder', '~> 2.5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'bootsnap', '>= 1.1.0', require: false # Reduces boot times through caching - group :development, :test do gem 'pry-byebug' # integrate proper debugging gem 'pry-rails' # replace IRB diff --git a/Gemfile.lock b/Gemfile.lock index 07e612f..8666faf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,8 +78,6 @@ GEM ast (2.4.2) base64 (0.2.0) bigdecimal (3.1.5) - bootsnap (1.17.0) - msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) coderay (1.1.3) @@ -98,7 +96,7 @@ GEM i18n (1.14.1) concurrent-ruby (~> 1.0) io-console (0.7.1) - irb (1.10.1) + irb (1.11.0) rdoc reline (>= 0.3.8) json (2.7.1) @@ -118,7 +116,6 @@ GEM method_source (1.0.0) mini_mime (1.1.5) minitest (5.20.0) - msgpack (1.7.2) mutex_m (0.2.0) net-imap (0.4.8) date @@ -146,7 +143,7 @@ GEM pry (>= 0.10.4) psych (5.1.2) stringio - puma (4.3.12) + puma (6.4.0) nio4r (~> 2.0) racc (1.7.3) rack (3.0.8) @@ -246,16 +243,15 @@ PLATFORMS x86_64-linux DEPENDENCIES - bootsnap (>= 1.1.0) fabrication listen pry-byebug pry-rails - puma (~> 4.3) + puma rails rspec-rails rubocop sqlite3 BUNDLED WITH - 2.3.23 + 2.5.1 From fcfe76fa0265f4a1e3ea6a3a31e46b0d73add5e8 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Thu, 21 Dec 2023 10:05:35 +0100 Subject: [PATCH 07/13] Re-Add bootsnap --- Gemfile | 2 ++ Gemfile.lock | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Gemfile b/Gemfile index 12f9c9e..bee5109 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,8 @@ gem 'puma' # app server # gem 'jbuilder', '~> 2.5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'bootsnap', require: false # Reduces boot times through caching + group :development, :test do gem 'pry-byebug' # integrate proper debugging gem 'pry-rails' # replace IRB diff --git a/Gemfile.lock b/Gemfile.lock index 8666faf..44a07a9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,6 +78,8 @@ GEM ast (2.4.2) base64 (0.2.0) bigdecimal (3.1.5) + bootsnap (1.17.0) + msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) coderay (1.1.3) @@ -116,6 +118,7 @@ GEM method_source (1.0.0) mini_mime (1.1.5) minitest (5.20.0) + msgpack (1.7.2) mutex_m (0.2.0) net-imap (0.4.8) date @@ -243,6 +246,7 @@ PLATFORMS x86_64-linux DEPENDENCIES + bootsnap fabrication listen pry-byebug From 57fa9d2799a0725dab9d3819e67fcf7810fd79ff Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Thu, 21 Dec 2023 10:35:08 +0100 Subject: [PATCH 08/13] Fix json method by making param optional --- app/models/heartbeat.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/heartbeat.rb b/app/models/heartbeat.rb index 42e1a61..4e7fa98 100644 --- a/app/models/heartbeat.rb +++ b/app/models/heartbeat.rb @@ -18,7 +18,8 @@ def register(new_state) ) end - def as_json(_req) + def as_json(_req = nil) + require 'pry'; binding.pry { application: application, team: team, From 58ab219642399eae27abe75dc2667ac3f7ccd460 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Thu, 21 Dec 2023 16:16:18 +0100 Subject: [PATCH 09/13] Switch port to reflect openshift configuration --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1295459..39be158 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,4 +103,4 @@ RUN bundle config set --local deployment 'true' \ USER 1001 -CMD ["bundle", "exec", "puma", "-t", "8"] +CMD ["bundle", "exec", "puma", "-t", "8", "-p", "8080"] From 0a6fb0755beeb1fba6ce07bc62715b10a0abb2a9 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Thu, 21 Dec 2023 16:36:49 +0100 Subject: [PATCH 10/13] Remove forgotten pry --- app/models/heartbeat.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/heartbeat.rb b/app/models/heartbeat.rb index 4e7fa98..ce3d206 100644 --- a/app/models/heartbeat.rb +++ b/app/models/heartbeat.rb @@ -19,7 +19,6 @@ def register(new_state) end def as_json(_req = nil) - require 'pry'; binding.pry { application: application, team: team, From 3d870b92a2cd09403aab14d462afb1a0fea07a80 Mon Sep 17 00:00:00 2001 From: Matthias Viehweger Date: Thu, 21 Dec 2023 21:41:19 +0100 Subject: [PATCH 11/13] Enable accessing the DB via CLI --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 39be158..d15d377 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,7 +74,7 @@ SHELL ["/bin/bash", "-c"] RUN adduser --disabled-password --uid 1001 --gid 0 --gecos "" app ARG BUNDLE_WITHOUT='development:metrics:test' -ARG RUN_PACKAGES +ARG RUN_PACKAGES='sqlite3' ENV RAILS_ENV=production \ RAILS_DB_ADAPTER=sqlite3 From 7e5c624ddf44e8bdb51bde7b739e8fb008c7a9ed Mon Sep 17 00:00:00 2001 From: Matthias Viehweger Date: Thu, 21 Dec 2023 21:41:52 +0100 Subject: [PATCH 12/13] SQLite is production-ready AND a perfect fit for the project --- config/environments/production.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index b364066..ba286aa 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -68,4 +68,7 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # SQLite is production-ready AND a perfect fit for the project + config.active_record.sqlite3_production_warning = false end From 5a79848ed06cead533fb8b66f45bd3f1771b2947 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Fri, 22 Dec 2023 10:14:59 +0100 Subject: [PATCH 13/13] Update README --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b46abf5..c888df4 100644 --- a/README.md +++ b/README.md @@ -30,21 +30,16 @@ Create the route sed "s#HOSTNAME_PLACEHOLDER#$hostname#" | \ oc apply -f - -Create deployment and build +Create deployment bundle exec rake secret > secret oc create secret generic statuscope-rails --from-file=secret_key_base=secret rm secret oc apply -f openshift/ - oc start-build statuscope -Wait for the build +Tag the image from your relevant registry that the GitHub build pushed it to - oc logs -f bc/statuscope - -Wait for the triggered deployment - - oc get pod -w + oc tag your-registry.ch/your-namespace/statuscope:latest statuscope:latest Aaand it's done.