diff --git a/.travis.yml b/.travis.yml index a329920..dad235b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,34 @@ addons: packages: - postgresql-10 - postgresql-client-10 + - postgresql-contrib-10 + # the following are mastodon dependencies + - imagemagick + - ffmpeg + - libpq-dev + - libxml2-dev + - libxslt1-dev + - file + - git-core + - g++ + - libprotobuf-dev + - protobuf-compiler + - pkg-config nodejs + - gcc + - autoconf + - bison + - build-essential + - libssl-dev + - libyaml-dev + - libreadline6-dev + - zlib1g-dev + - libncurses5-dev + - libffi-dev + - libgdbm3 + - libgdbm-dev + - redis-tools + - libidn11-dev + - libicu-dev services: - redis-server before_install: diff --git a/bin/run-mastodon.js b/bin/run-mastodon.js index ed104ff..314466a 100644 --- a/bin/run-mastodon.js +++ b/bin/run-mastodon.js @@ -15,13 +15,14 @@ const dir = __dirname const GIT_URL = 'https://github.com/nolanlawson/mastodon' const GIT_BRANCH = 'for-pinafore' +const DB_USER = 'nolan' const envFile = ` PAPERCLIP_SECRET=foo SECRET_KEY_BASE=bar OTP_SECRET=foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar DB_PORT=${process.env.PGPORT || 5432} -DB_USER=nolan +DB_USER=${DB_USER} ` const mastodonDir = path.join(dir, '../mastodon') @@ -42,12 +43,12 @@ async function cloneMastodon () { async function setupMastodonDatabase () { console.log('Setting up mastodon database...') try { - await exec('dropdb mastodon_development', {cwd: mastodonDir}) + await exec(`dropdb -U ${DB_USER} mastodon_development`, {cwd: mastodonDir}) } catch (e) { /* ignore */ } - await exec('createdb mastodon_development', {cwd: mastodonDir}) + await exec(`createdb -U ${DB_USER} mastodon_development`, {cwd: mastodonDir}) let dumpFile = path.join(dir, '../fixtures/dump.sql') - await exec(`pg_restore -Fc -d mastodon_development "${dumpFile}"`, {cwd: mastodonDir}) + await exec(`pg_restore -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')