chore: cache bundler correctly in CircleCI (#1898)

This commit is contained in:
Nolan Lawson 2020-11-23 16:29:03 -08:00 committed by GitHub
parent f2e51bbbfe
commit a124ba9dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -10,8 +10,7 @@ const writeFile = promisify(fs.writeFile)
const dir = __dirname
const GIT_URL = 'https://github.com/tootsuite/mastodon.git'
const GIT_TAG_OR_COMMIT = 'v3.1.3'
const GIT_BRANCH = 'master'
const GIT_TAG = 'v3.1.3'
const mastodonDir = path.join(dir, '../mastodon')
@ -20,9 +19,7 @@ export default async function cloneMastodon () {
await stat(mastodonDir)
} catch (e) {
console.log('Cloning mastodon...')
await exec(`git clone --single-branch --branch ${GIT_BRANCH} ${GIT_URL} "${mastodonDir}"`)
await exec('git fetch origin --tags', { cwd: mastodonDir }) // may already be cloned, e.g. in CI
await exec(`git checkout ${GIT_TAG_OR_COMMIT}`, { cwd: mastodonDir })
await exec(`git clone --single-branch --branch ${GIT_TAG} ${GIT_URL} "${mastodonDir}"`)
await writeFile(path.join(dir, '../mastodon/.env'), envFile, 'utf8')
}
}

View File

@ -59,7 +59,7 @@ async function runMastodon () {
const cwd = mastodonDir
const cmds = [
'gem install bundler foreman',
'bundle install',
'bundle install --frozen',
'bundle exec rails db:migrate',
'yarn --pure-lockfile'
]