attempt to fix travis tests

This commit is contained in:
Nolan Lawson 2018-04-10 16:45:51 -07:00
parent b3e859f89d
commit 5911769cdd
2 changed files with 33 additions and 4 deletions

View file

@ -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:

View file

@ -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')