diff --git a/.travis.yml b/.travis.yml index cee24086..882ba237 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ before_install: - node --version - postgres --version - redis-server --version - - psql -c "CREATE USER nolan CREATEDB;" + - psql -d template1 -c "CREATE USER nolan CREATEDB;" before_script: - npm run lint script: npm run test-browser diff --git a/bin/run-mastodon.js b/bin/run-mastodon.js index 314466ad..2bb6415a 100644 --- a/bin/run-mastodon.js +++ b/bin/run-mastodon.js @@ -21,6 +21,7 @@ const envFile = ` PAPERCLIP_SECRET=foo SECRET_KEY_BASE=bar OTP_SECRET=foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar +DB_HOST=127.0.0.1 DB_PORT=${process.env.PGPORT || 5432} DB_USER=${DB_USER} ` @@ -43,12 +44,12 @@ async function cloneMastodon () { async function setupMastodonDatabase () { console.log('Setting up mastodon database...') try { - await exec(`dropdb -U ${DB_USER} mastodon_development`, {cwd: mastodonDir}) + await exec(`dropdb -h 127.0.0.1 -U ${DB_USER} mastodon_development`, {cwd: mastodonDir}) } catch (e) { /* ignore */ } - await exec(`createdb -U ${DB_USER} mastodon_development`, {cwd: mastodonDir}) + await exec(`createdb -h 127.0.0.1 -U ${DB_USER} mastodon_development`, {cwd: mastodonDir}) let dumpFile = path.join(dir, '../fixtures/dump.sql') - await exec(`pg_restore -U ${DB_USER} -Fc -d mastodon_development "${dumpFile}"`, {cwd: mastodonDir}) + await exec(`pg_restore -h 127.0.0.1 -U ${DB_USER} -Fc -d mastodon_development "${dumpFile}"`, {cwd: mastodonDir}) let tgzFile = path.join(dir, '../fixtures/system.tgz') let systemDir = path.join(mastodonDir, 'public/system')