Upgrade to Ruby 3.3.4 in production

Oh right, I did a dev-side version of this, and forgot prod needs it
too! (Maybe a bit silly to bother for a patch-level but whatever!)
This commit is contained in:
Emi Matchu 2024-08-31 12:49:50 -07:00
parent 1972ecf043
commit e67830642c
3 changed files with 15 additions and 15 deletions

View file

@ -60,7 +60,7 @@
- name: Configure Bundler to run in deployment mode - name: Configure Bundler to run in deployment mode
command: command:
chdir: "{{ remote_app_root }}" chdir: "{{ remote_app_root }}"
cmd: /opt/ruby-3.3.0/bin/bundle config set --local deployment true cmd: /opt/ruby-3.3.4/bin/bundle config set --local deployment true
# This ensures that, while attempting our current deploy, we don't # This ensures that, while attempting our current deploy, we don't
# accidentally delete gems out from under the currently-running version. # accidentally delete gems out from under the currently-running version.
@ -70,7 +70,7 @@
- name: Configure Bundler to *not* clean up old gems when installing - name: Configure Bundler to *not* clean up old gems when installing
command: command:
chdir: "{{ remote_app_root }}" chdir: "{{ remote_app_root }}"
cmd: /opt/ruby-3.3.0/bin/bundle config set --local clean false cmd: /opt/ruby-3.3.4/bin/bundle config set --local clean false
# NOTE: Bundler recommends this, and they're pretty smart about it: if the # NOTE: Bundler recommends this, and they're pretty smart about it: if the
# Gemfile changes, this shouldn't disrupt the currently-running version, # Gemfile changes, this shouldn't disrupt the currently-running version,
@ -79,7 +79,7 @@
- name: Configure Bundler to use the bundle folder shared by all app versions - name: Configure Bundler to use the bundle folder shared by all app versions
command: command:
chdir: "{{ remote_app_root }}" chdir: "{{ remote_app_root }}"
cmd: "/opt/ruby-3.3.0/bin/bundle config set --local path {{ remote_project_root}}/shared/bundle" cmd: "/opt/ruby-3.3.4/bin/bundle config set --local path {{ remote_project_root}}/shared/bundle"
- name: Run `bundle install` to install dependencies in remote folder - name: Run `bundle install` to install dependencies in remote folder
command: command:
@ -87,7 +87,7 @@
# The `--local` flag instructs Bundler to use the cached dependencies # The `--local` flag instructs Bundler to use the cached dependencies
# in `vendor/cache`, instead of reading from the web, which is much # in `vendor/cache`, instead of reading from the web, which is much
# faster and more reliable! # faster and more reliable!
cmd: /opt/ruby-3.3.0/bin/bundle install --local cmd: /opt/ruby-3.3.4/bin/bundle install --local
- name: Update the `current` folder to point to the new version - name: Update the `current` folder to point to the new version
file: file:
@ -111,7 +111,7 @@
- name: Clean up gems no longer used in the current app version - name: Clean up gems no longer used in the current app version
command: command:
chdir: "{{ remote_app_root }}" chdir: "{{ remote_app_root }}"
cmd: /opt/ruby-3.3.0/bin/bundle clean cmd: /opt/ruby-3.3.4/bin/bundle clean
when: not skip_set_as_current when: not skip_set_as_current
- name: Find older app versions to clean up - name: Find older app versions to clean up

View file

@ -5,7 +5,7 @@ Description=Dress to Impress webapp
User=impress User=impress
Restart=always Restart=always
WorkingDirectory=/srv/impress/current WorkingDirectory=/srv/impress/current
ExecStart=/opt/ruby-3.3.0/bin/bundle exec falcon host ExecStart=/opt/ruby-3.3.4/bin/bundle exec falcon host
Environment="RAILS_ENV=production" Environment="RAILS_ENV=production"
; Set EXECJS_RUNTIME to save us from needing to install Node ; Set EXECJS_RUNTIME to save us from needing to install Node
Environment="EXECJS_RUNTIME=Disabled" Environment="EXECJS_RUNTIME=Disabled"

View file

@ -170,21 +170,21 @@
git: git:
repo: https://github.com/rbenv/ruby-build.git repo: https://github.com/rbenv/ruby-build.git
dest: /opt/ruby-build dest: /opt/ruby-build
version: e1b36a32fb87d61955ac38f1889b7e3cb3b2f407 version: d22fa95a6e4c77945304c16ebe0d9513fec98cfb
- name: Check if Ruby 3.3.0 is already installed - name: Check if Ruby 3.3.4 is already installed
stat: stat:
path: /opt/ruby-3.3.0 path: /opt/ruby-3.3.4
register: ruby_dir register: ruby_dir
- name: Install Ruby 3.3.0 - name: Install Ruby 3.3.4
command: "/opt/ruby-build/bin/ruby-build 3.3.0 /opt/ruby-3.3.0" command: "/opt/ruby-build/bin/ruby-build 3.3.4 /opt/ruby-3.3.4"
when: not ruby_dir.stat.exists when: not ruby_dir.stat.exists
- name: Add Ruby 3.3.0 to the global PATH, for developer convenience - name: Add Ruby 3.3.4 to the global PATH, for developer convenience
copy: copy:
dest: /etc/profile.d/ruby_path.sh dest: /etc/profile.d/ruby_path.sh
content: PATH="/opt/ruby-3.3.0/bin:$PATH" content: PATH="/opt/ruby-3.3.4/bin:$PATH"
- name: Install system dependencies for impress's Ruby gems - name: Install system dependencies for impress's Ruby gems
apt: apt:
@ -248,14 +248,14 @@
become_user: impress become_user: impress
command: command:
chdir: /srv/impress/versions/initial-placeholder chdir: /srv/impress/versions/initial-placeholder
cmd: /opt/ruby-3.3.0/bin/bundle config set --local deployment true cmd: /opt/ruby-3.3.4/bin/bundle config set --local deployment true
when: not current_app_version.stat.exists when: not current_app_version.stat.exists
- name: Install the placeholder app's dependencies - name: Install the placeholder app's dependencies
become_user: impress become_user: impress
command: command:
chdir: /srv/impress/versions/initial-placeholder chdir: /srv/impress/versions/initial-placeholder
cmd: /opt/ruby-3.3.0/bin/bundle install cmd: /opt/ruby-3.3.4/bin/bundle install
when: not current_app_version.stat.exists when: not current_app_version.stat.exists
- name: Set the placeholder app as the current version - name: Set the placeholder app as the current version