Run assets precompile before database setup

This is so that if the precompile is killed due to OOM, you can just restart the playbook without needing to change the database
name in .env.production as it isn't created yet.
This commit is contained in:
staticsafe 2017-11-27 11:54:40 -05:00
parent 5f12cf17d1
commit 6f503dedfe
1 changed files with 8 additions and 8 deletions

View File

@ -52,6 +52,14 @@
dest: /home/mastodon/live/.env.production
become: true
become_user: mastodon
- name: Precompile Mastodon static assets
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rails assets:precompile
environment:
RAILS_ENV: production
args:
executable: /bin/bash
become: true
become_user: mastodon
- name: Run Mastodon database setup
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rails db:setup
environment:
@ -61,14 +69,6 @@
executable: /bin/bash
become: true
become_user: mastodon
- name: Precompile Mastodon static assets
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rails assets:precompile
environment:
RAILS_ENV: production
args:
executable: /bin/bash
become: true
become_user: mastodon
- name: Add Mastodon media cache cleanup cronjob
cron:
name: "Mastodon media cache cleanup"