more work on testing

This commit is contained in:
Nolan Lawson 2018-02-18 10:42:27 -08:00
parent 6bcbfdc59e
commit 5196109e0c
6 changed files with 68 additions and 75 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ yarn.lock
cypress/screenshots
templates/.*
assets/*.css
/mastodon

33
bin/setup-mastodon.js Normal file
View File

@ -0,0 +1,33 @@
const pify = require('pify')
const exec = require('child-process-promise').exec;
const dir = __dirname
const path = require('path')
const fs = require('fs')
const exists = pify(fs.exists.bind(fs))
const writeFile = pify(fs.writeFile.bind(fs))
const envFile = `
PAPERCLIP_SECRET=foo
SECRET_KEY_BASE=bar
OTP_SECRET=foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar
`
async function main() {
let mastodonDir = path.join(dir, '../mastodon')
if (!(await exists(mastodonDir))) {
await exec(`git clone https://github.com/tootsuite/mastodon "${mastodonDir}"`)
await exec(`git checkout v2.2.0`, {cwd: mastodonDir})
await writeFile(path.join(dir, '../mastodon/.env'), envFile, 'utf8')