From a124ba9dc83912962665b4fed621023ad7e8ed13 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 23 Nov 2020 16:29:03 -0800 Subject: [PATCH] chore: cache bundler correctly in CircleCI (#1898) --- bin/clone-mastodon.js | 7 ++----- bin/run-mastodon.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/clone-mastodon.js b/bin/clone-mastodon.js index ad400951..31fbfe18 100644 --- a/bin/clone-mastodon.js +++ b/bin/clone-mastodon.js @@ -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') } } diff --git a/bin/run-mastodon.js b/bin/run-mastodon.js index 7805a2f4..2821dcde 100644 --- a/bin/run-mastodon.js +++ b/bin/run-mastodon.js @@ -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' ]