From 09b5474e22451ce209fc8daedd1f781a307fbde9 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 15 Feb 2021 12:54:08 -0800 Subject: [PATCH] test: always migrate mastodon server when launching (#1941) This fixes some bugs in dev mode where the Mastodon DB might say it needs a Rails migration stil. --- bin/run-mastodon.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/run-mastodon.js b/bin/run-mastodon.js index ef0818d3..b80a533f 100644 --- a/bin/run-mastodon.js +++ b/bin/run-mastodon.js @@ -58,12 +58,11 @@ async function runMastodon () { DB_PORT }) const cwd = mastodonDir - const cmds = [ + const installCommands = [ 'gem update --system', 'gem install bundler foreman', 'bundle config set --local frozen \'true\'', 'bundle install', - 'bundle exec rails db:migrate', 'yarn --pure-lockfile' ] @@ -73,12 +72,13 @@ async function runMastodon () { console.log('Already installed Mastodon') } catch (e) { console.log('Installing Mastodon...') - for (const cmd of cmds) { + for (const cmd of installCommands) { console.log(cmd) await exec(cmd, { cwd, env }) } await writeFile(installedFile, '', 'utf8') } + await exec('bundle exec rails db:migrate', { cwd, env }) const promise = spawn('foreman', ['start'], { cwd, env }) // don't bother writing to mastodon.log in CI; we can't read the file anyway const logFile = process.env.CIRCLECI ? '/dev/null' : 'mastodon.log'