From 31bcdaa3ddfdb43fae1118f4ef5d6123af42a73c Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Thu, 4 Jul 2024 23:50:07 -0700 Subject: [PATCH] chore: Upgrade ruby to 3.3.3 (#9664) - Upgrade the ruby version to 3.3.3 --------- Co-authored-by: Vishnu Narayanan --- .circleci/config.yml | 2 +- .devcontainer/docker-compose.yml | 4 ++-- .ruby-version | 2 +- Gemfile | 2 +- Gemfile.lock | 31 +++++++++++++++------------- deployment/chatwoot-web.1.service | 6 +++--- deployment/chatwoot-worker.1.service | 6 +++--- deployment/setup_20.04.sh | 4 ++-- docker/Dockerfile | 10 ++++----- 9 files changed, 35 insertions(+), 32 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c67063ae6..cdddc4a06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ defaults: &defaults working_directory: ~/build docker: # specify the version you desire here - - image: cimg/ruby:3.2.2-browsers + - image: cimg/ruby:3.3.3-browsers # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 17021d1e7..a804bb15c 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -12,7 +12,7 @@ services: args: VARIANT: "ubuntu-22.04" NODE_VERSION: "20.9.0" - RUBY_VERSION: "3.2.2" + RUBY_VERSION: "3.3.3" # On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000. USER_UID: "1000" USER_GID: "1000" @@ -25,7 +25,7 @@ services: args: VARIANT: "ubuntu-22.04" NODE_VERSION: "20.9.0" - RUBY_VERSION: "3.2.2" + RUBY_VERSION: "3.3.3" # On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000. USER_UID: "1000" USER_GID: "1000" diff --git a/.ruby-version b/.ruby-version index be94e6f53..619b53766 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.3.3 diff --git a/Gemfile b/Gemfile index ad66c46c6..d7bfb6258 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby '3.2.2' +ruby '3.3.3' ##-- base gems for rails --## gem 'rack-cors', '2.0.0', require: 'rack/cors' diff --git a/Gemfile.lock b/Gemfile.lock index 54226c13a..23da215bc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -183,13 +183,16 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.3.4) - ddtrace (1.11.1) - debase-ruby_core_source (>= 0.10.16, <= 3.2.0) - libdatadog (~> 2.0.0.1.0) - libddwaf (~> 1.8.2.0.0) + datadog-ci (0.8.3) msgpack - debase-ruby_core_source (3.2.0) + date (3.3.4) + ddtrace (1.23.2) + datadog-ci (~> 0.8.1) + debase-ruby_core_source (= 3.3.1) + libdatadog (~> 7.0.0.1.0) + libddwaf (~> 1.14.0.0.0) + msgpack + debase-ruby_core_source (3.3.1) debug (1.8.0) irb (>= 1.5.0) reline (>= 0.3.1) @@ -416,15 +419,15 @@ GEM addressable (~> 2.8) letter_opener (1.8.1) launchy (>= 2.2, < 3) - libdatadog (2.0.0.1.0) - libdatadog (2.0.0.1.0-x86_64-linux) - libddwaf (1.8.2.0.0) + libdatadog (7.0.0.1.0) + libdatadog (7.0.0.1.0-x86_64-linux) + libddwaf (1.14.0.0.0) ffi (~> 1.0) - libddwaf (1.8.2.0.0-arm64-darwin) + libddwaf (1.14.0.0.0-arm64-darwin) ffi (~> 1.0) - libddwaf (1.8.2.0.0-x86_64-darwin) + libddwaf (1.14.0.0.0-x86_64-darwin) ffi (~> 1.0) - libddwaf (1.8.2.0.0-x86_64-linux) + libddwaf (1.14.0.0.0-x86_64-linux) ffi (~> 1.0) line-bot-api (1.28.0) liquid (5.4.0) @@ -962,7 +965,7 @@ DEPENDENCIES working_hours RUBY VERSION - ruby 3.2.2p185 + ruby 3.3.3p89 BUNDLED WITH - 2.4.6 + 2.5.14 diff --git a/deployment/chatwoot-web.1.service b/deployment/chatwoot-web.1.service index 37889b1aa..049ec85db 100644 --- a/deployment/chatwoot-web.1.service +++ b/deployment/chatwoot-web.1.service @@ -16,10 +16,10 @@ KillMode=mixed StandardInput=null SyslogIdentifier=%p -Environment="PATH=/home/chatwoot/.rvm/gems/ruby-3.2.2/bin:/home/chatwoot/.rvm/gems/ruby-3.2.2@global/bin:/home/chatwoot/.rvm/rubies/ruby-3.2.2/bin:/home/chatwoot/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/chatwoot/.rvm/bin:/home/chatwoot/.rvm/bin" +Environment="PATH=/home/chatwoot/.rvm/gems/ruby-3.3.3/bin:/home/chatwoot/.rvm/gems/ruby-3.3.3@global/bin:/home/chatwoot/.rvm/rubies/ruby-3.3.3/bin:/home/chatwoot/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/chatwoot/.rvm/bin:/home/chatwoot/.rvm/bin" Environment="PORT=3000" Environment="RAILS_ENV=production" Environment="NODE_ENV=production" Environment="RAILS_LOG_TO_STDOUT=true" -Environment="GEM_HOME=/home/chatwoot/.rvm/gems/ruby-3.2.2" -Environment="GEM_PATH=/home/chatwoot/.rvm/gems/ruby-3.2.2:/home/chatwoot/.rvm/gems/ruby-3.2.2@global" +Environment="GEM_HOME=/home/chatwoot/.rvm/gems/ruby-3.3.3" +Environment="GEM_PATH=/home/chatwoot/.rvm/gems/ruby-3.3.3:/home/chatwoot/.rvm/gems/ruby-3.3.3@global" diff --git a/deployment/chatwoot-worker.1.service b/deployment/chatwoot-worker.1.service index 8000743c4..cbb97e88c 100644 --- a/deployment/chatwoot-worker.1.service +++ b/deployment/chatwoot-worker.1.service @@ -16,10 +16,10 @@ KillMode=mixed StandardInput=null SyslogIdentifier=%p -Environment="PATH=/home/chatwoot/.rvm/gems/ruby-3.2.2/bin:/home/chatwoot/.rvm/gems/ruby-3.2.2@global/bin:/home/chatwoot/.rvm/rubies/ruby-3.2.2/bin:/home/chatwoot/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/chatwoot/.rvm/bin:/home/chatwoot/.rvm/bin" +Environment="PATH=/home/chatwoot/.rvm/gems/ruby-3.3.3/bin:/home/chatwoot/.rvm/gems/ruby-3.3.3@global/bin:/home/chatwoot/.rvm/rubies/ruby-3.3.3/bin:/home/chatwoot/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/chatwoot/.rvm/bin:/home/chatwoot/.rvm/bin" Environment="PORT=3000" Environment="RAILS_ENV=production" Environment="NODE_ENV=production" Environment="RAILS_LOG_TO_STDOUT=true" -Environment="GEM_HOME=/home/chatwoot/.rvm/gems/ruby-3.2.2" -Environment="GEM_PATH=/home/chatwoot/.rvm/gems/ruby-3.2.2:/home/chatwoot/.rvm/gems/ruby-3.2.2@global" +Environment="GEM_HOME=/home/chatwoot/.rvm/gems/ruby-3.3.3" +Environment="GEM_PATH=/home/chatwoot/.rvm/gems/ruby-3.3.3:/home/chatwoot/.rvm/gems/ruby-3.3.3@global" diff --git a/deployment/setup_20.04.sh b/deployment/setup_20.04.sh index 8918e9d54..2f8d83f8b 100644 --- a/deployment/setup_20.04.sh +++ b/deployment/setup_20.04.sh @@ -336,8 +336,8 @@ function setup_chatwoot() { sudo -i -u chatwoot << EOF rvm --version rvm autolibs disable - rvm install "ruby-3.2.2" - rvm use 3.2.2 --default + rvm install "ruby-3.3.3" + rvm use 3.3.3 --default git clone https://github.com/chatwoot/chatwoot.git cd chatwoot diff --git a/docker/Dockerfile b/docker/Dockerfile index 6503530b7..9dcc73ad9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # pre-build stage -FROM ruby:3.2.2-alpine3.18 AS pre-builder +FROM ruby:3.3.3-alpine3.19 AS pre-builder # ARG default to production settings # For development docker-compose file overrides ARGS @@ -25,7 +25,7 @@ RUN apk update && apk add --no-cache \ tzdata \ postgresql-dev \ postgresql-client \ - nodejs-current \ + nodejs=20.12.1-r0 \ yarn \ git \ && mkdir -p /var/app \ @@ -67,13 +67,13 @@ RUN if [ "$RAILS_ENV" = "production" ]; then \ RUN git rev-parse HEAD > /app/.git_sha # Remove unnecessary files -RUN rm -rf /gems/ruby/3.2.0/cache/*.gem \ - && find /gems/ruby/3.2.0/gems/ \( -name "*.c" -o -name "*.o" \) -delete \ +RUN rm -rf /gems/ruby/3.3.0/cache/*.gem \ + && find /gems/ruby/3.3.0/gems/ \( -name "*.c" -o -name "*.o" \) -delete \ && rm -rf .git \ && rm .gitignore # final build stage -FROM ruby:3.2.2-alpine3.18 +FROM ruby:3.3.3-alpine3.19 ARG BUNDLE_WITHOUT="development:test"