With post-deployement the 2nd time; allow to upgrade rbenv if needed; upgrade browsers list db to remove warnings
gitea/ansible-roles/pipeline/head This commit looks good Details

This commit is contained in:
Mathieu Gauthier-Pilote 2023-04-06 14:46:01 -04:00
parent d992da0c1e
commit 1b6527c4ce
1 changed files with 14 additions and 2 deletions

View File

@ -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