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

This commit is contained in:
Mathieu Gauthier-Pilote 2023-04-06 14:46:01 -04:00
parent d992da0c1e
commit 1b6527c4ce

View file

@ -8,12 +8,19 @@
target: "~/{{ service }}_production.sql.gz" target: "~/{{ service }}_production.sql.gz"
become_user: postgres 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) - name: Checkout (git)
git: git:
repo: "{{ git_url }}" repo: "{{ git_url }}"
dest: "~/mastodon/" dest: "~/mastodon/"
version: "{{ git_version | default(omit) }}" version: "{{ git_version | default(omit) }}"
#force: yes force: yes
update: yes update: yes
become_user: "{{ service }}" become_user: "{{ service }}"
@ -33,6 +40,11 @@
args: args:
chdir: "~/mastodon" chdir: "~/mastodon"
executable: /bin/bash # fails with /bin/sh 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 - name: Run database migrations, skipping post-deployment
shell: ". ~/.profile && SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate" shell: ". ~/.profile && SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate"
args: args:
@ -57,7 +69,7 @@
state: restarted state: restarted
- name: Run database migrations, this time including post-deployment - 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: args:
chdir: "~/mastodon" chdir: "~/mastodon"
executable: /bin/bash # fails with /bin/sh executable: /bin/bash # fails with /bin/sh