From 40112960f1a0127b5d8535919fd0cf453be27a1e Mon Sep 17 00:00:00 2001 From: Simon Plenderleith Date: Wed, 12 Sep 2018 16:47:11 +0100 Subject: [PATCH] Remove CircleCI 1.0 support from the rebuild command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #517. 🐿 v2.10.2 --- tasks/rebuild.js | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/tasks/rebuild.js b/tasks/rebuild.js index 6df3460e..ceb02fb5 100644 --- a/tasks/rebuild.js +++ b/tasks/rebuild.js @@ -31,10 +31,6 @@ async function circleFetch (path, opts) { } } -const clearCache = (project) => circleFetch(`/${project}/build-cache`, { method: 'DELETE' }); - -const rebuildMasterBuild = (project) => circleFetch(`/${project}/tree/master`, { method: 'POST' }); - const triggerMasterBuild = (project) => circleFetch(`/${project}/build`, { method: 'POST', body: JSON.stringify({ branch: 'master' }) }); const lastMasterBuild = (project) => circleFetch(`/${project}/tree/master`); @@ -75,28 +71,10 @@ async function task (options) { console.log(`Considering whether to rebuild ${app}`); // eslint-disable-line no-console try { const [lastBuild] = await lastMasterBuild(app); - - switch (lastBuild.platform) { - case '1.0': - if (lastBuild.status !== 'running' && lastBuild.status !== 'not_running') { - console.log(`Clearing cache and triggering rebuild of last master build of ${app} (${lastBuild.committer_name}: ${lastBuild.subject ? lastBuild.subject.replace(/\n/g, ' ') : 'No subject'})`); // eslint-disable-line no-console - await clearCache(app); - await rebuildMasterBuild(app); - } else { - console.log(`Skipping rebuild of ${app} because job already exists.`); // eslint-disable-line no-console - } - break; - case '2.0': - console.log(`Triggering master build for ${app} (git commit: ${lastBuild.vcs_revision})`); // eslint-disable-line no-console - await triggerMasterBuild(app); - break; - default: - throw new Error(`CircleCI platform version ${lastBuild.platform} is not supported by this command`); - break; - } - + console.log(`Triggering master build for ${app} (git commit: ${lastBuild.vcs_revision})`); // eslint-disable-line no-console + await triggerMasterBuild(app); } catch (error) { - console.log(`Skipped rebuild of ${app} probably because Circle CI not set up for this repo`); // eslint-disable-line no-console + console.log(`Skipped rebuild of ${app}, probably because Circle CI not set up for this repo`); // eslint-disable-line no-console } })); };