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 } })); };