Fixes to make it start properly from clean

This commit is contained in:
Erik Stambaugh 2024-01-23 15:58:04 -08:00
parent 7e9859838e
commit 17178eb842

View file

@ -127,6 +127,11 @@
# -- it's in lib/tasks/mastodon.rake under User.new
# or https://docs.joinmastodon.org/admin/tootctl/#accounts-create
- name: wait for the db to come up
command: timeout --foreground 300 bash -c -- 'until docker compose exec -t mastodon_db psql -U postgres mastodon_production -P pager=off -c "\\dt"; do sleep 1; done'
args:
chdir: /srv/mastodon
- name: check for any tables at all
command: docker compose exec -t mastodon_db psql -U postgres mastodon_production -P pager=off -c '\dt'
args:
@ -137,7 +142,7 @@
command: docker compose run -t --rm mastodon_web bundle exec rails db:setup
args:
chdir: /srv/mastodon
when: hazschema.stdout is match("Did not find any relations")
when: hazschema.stderr is match("Did not find any relations")
register: newschema
- name: check whether our admin account has been created yet
@ -145,7 +150,9 @@
register: accountcount
- name: create admin account
command: "docker exec -it mastodon_web bash -c 'RAILS_ENV=production tootctl accounts create meat --email {{ admin_email }} --confirmed --role Owner'"
command: "docker compose exec -it mastodon_web bash -c 'RAILS_ENV=production tootctl accounts create meat --email {{ admin_email }} --confirmed --role Owner'"
args:
chdir: /srv/mastodon
when: accountcount.stdout == "1"