Skip to content

Commit

Permalink
Upgrade ruby in provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Jul 28, 2022
1 parent 07edde5 commit cd82718
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion provisioning/roles/morph-app/templates/sites/morph.io
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server {
server_name {{ server_name }} api.{{ server_name }};
root /var/www/current/public;
passenger_enabled on;
passenger_ruby /home/deploy/.rvm/gems/ruby-2.4.10/wrappers/ruby;
passenger_ruby /home/deploy/.rvm/gems/ruby-2.5.9/wrappers/ruby;
passenger_max_request_queue_size 300;

# There's a lot of traffic coming to this one scraper. It was putting
Expand Down
4 changes: 2 additions & 2 deletions provisioning/roles/ruby/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
- name: Make ruby-2.4.10 the default
command: /bin/sh -l -c 'rvm alias create default ruby-2.4.10'
- name: Make ruby-2.5.9 the default
command: /bin/sh -l -c 'rvm alias create default ruby-2.5.9'
become_user: deploy
12 changes: 6 additions & 6 deletions provisioning/roles/ruby/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# TODO: Is it possible to extract this list of dependencies automatically from rvm?
# Or allow rvm to do the install - but that would require the deploy user to have the permissions
- name: "Ensure ruby-2.4.10 dependencies installed"
- name: "Ensure ruby-2.5.9 dependencies installed"
apt: pkg={{ item }}
with_items:
- patch
Expand All @@ -37,11 +37,11 @@
- libssl-dev
- libgmp-dev

- name: Install ruby-2.4.10 with rvm
command: /bin/sh -l -c 'rvm install ruby-2.4.10 --autolibs=read-fail' creates=/home/deploy/.rvm/rubies/ruby-2.4.10
- name: Install ruby-2.5.9 with rvm
command: /bin/sh -l -c 'rvm install ruby-2.5.9 --autolibs=read-fail' creates=/home/deploy/.rvm/rubies/ruby-2.5.9
become_user: deploy
notify: Make ruby-2.4.10 the default
notify: Make ruby-2.5.9 the default

- name: Install bundler for ruby 2.4.10
command: bash -lc "rvm ruby-2.4.10; gem install bundler --version 2.0.2"
- name: Install bundler for ruby 2.5.9
command: bash -lc "rvm ruby-2.5.9; gem install bundler --version 2.0.2"
become_user: deploy

0 comments on commit cd82718

Please sign in to comment.