From 1b6527c4cec6d784ea1b8b48a7707281cca23a95 Mon Sep 17 00:00:00 2001 From: Mathieu Gauthier-Pilote Date: Thu, 6 Apr 2023 14:46:01 -0400 Subject: [PATCH] With post-deployement the 2nd time; allow to upgrade rbenv if needed; upgrade browsers list db to remove warnings --- webapps/mastodon/tasks/upgrade.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/webapps/mastodon/tasks/upgrade.yml b/webapps/mastodon/tasks/upgrade.yml index e0644c66..d1b8c57a 100644 --- a/webapps/mastodon/tasks/upgrade.yml +++ b/webapps/mastodon/tasks/upgrade.yml @@ -8,12 +8,19 @@ target: "~/{{ service }}_production.sql.gz" become_user: postgres +- name: Install Ruby for service user (rbenv) + include_role: + name: rbenv + vars: + - username: "{{ service }}" + - rbenv_ruby_version: "{{ ruby_version }}" + - name: Checkout (git) git: repo: "{{ git_url }}" dest: "~/mastodon/" version: "{{ git_version | default(omit) }}" - #force: yes + force: yes update: yes become_user: "{{ service }}" @@ -33,6 +40,11 @@ args: chdir: "~/mastodon" executable: /bin/bash # fails with /bin/sh + - name: Upgrade browsers list db + shell: ". ~/.profile && npx update-browserslist-db@latest" + args: + chdir: "~/mastodon" + executable: /bin/bash # fails with /bin/sh - name: Run database migrations, skipping post-deployment shell: ". ~/.profile && SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate" args: @@ -57,7 +69,7 @@ state: restarted - name: Run database migrations, this time including post-deployment - shell: ". ~/.profile && SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate" + shell: ". ~/.profile && RAILS_ENV=production bundle exec rails db:migrate" args: chdir: "~/mastodon" executable: /bin/bash # fails with /bin/sh