From 5bba2ea0ae75560b13c67e40feb64adee56659b3 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 22 Feb 2018 14:27:14 -0700 Subject: [PATCH] updated plugin reconciler, replaced docker commands --- Dockerfile | 1 - bin/cli-plugins | 59 +++++++++++++++++++++---------------------------- 2 files changed, 25 insertions(+), 35 deletions(-) diff --git a/Dockerfile b/Dockerfile index 95aa74d8a..4d0fea440 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,6 @@ ENV NODE_ENV production # Install app dependencies and build static assets. RUN yarn global add node-gyp && \ yarn install --frozen-lockfile && \ - cli plugins reconcile && \ yarn build && \ yarn cache clean diff --git a/bin/cli-plugins b/bin/cli-plugins index 7b829dbc8..ee331bff2 100755 --- a/bin/cli-plugins +++ b/bin/cli-plugins @@ -202,46 +202,38 @@ async function reconcileRemotePlugins({ dryRun, upgradeRemote }) { // This traverses the local plugins and installs any dependencies listed there, // this only is really needed for plugins that are installed via docker because // core plugins will have their dependencies already included in core. -async function reconcilePluginDeps({ skipRemote, dryRun, upgradeRemote }) { +async function reconcilePluginDeps({ dryRun, upgradeRemote }) { try { let startTime = new Date(); - // We don't need to do anything if we skip everything.... - if (skipRemote) { - return; - } - // Locate any external plugins and install them. - if (!skipRemote) { - const results = await reconcileRemotePlugins({ - skipRemote, - dryRun, - upgradeRemote, - }); + const results = await reconcileRemotePlugins({ + dryRun, + upgradeRemote, + }); - let status; - if (dryRun) { - status = '[dry-run] success'.green; - } else { - status = 'success'.green; - } - - let message; - if (results.upgradable.length === 0 && results.fetchable.length === 0) { - message = 'Already up-to-date.'; - } else if (results.upgradable.length === 0) { - message = `Fetched ${results.fetchable.length} new plugins.`; - } else if (results.fetchable.length === 0) { - message = `Upgraded ${results.upgradable.length} new plugins.`; - } else { - message = `Fetched ${results.fetchable.length} new plugins, upgraded ${ - results.upgradable.length - } plugins.`; - } - - console.log(`\n${status} ${message}`); + let status; + if (dryRun) { + status = '[dry-run] success'.green; + } else { + status = 'success'.green; } + let message; + if (results.upgradable.length === 0 && results.fetchable.length === 0) { + message = 'Already up-to-date.'; + } else if (results.upgradable.length === 0) { + message = `Fetched ${results.fetchable.length} new plugins.`; + } else if (results.fetchable.length === 0) { + message = `Upgraded ${results.upgradable.length} new plugins.`; + } else { + message = `Fetched ${results.fetchable.length} new plugins, upgraded ${ + results.upgradable.length + } plugins.`; + } + + console.log(`\n${status} ${message}`); + let endTime = new Date(); let totalTime = ((endTime.getTime() - startTime.getTime()) / 1000).toFixed( @@ -390,7 +382,6 @@ program '-d, --dry-run', 'does not actually change anything on the filesystem acts only as a simulation' ) - .option('--skip-remote', 'skips the remote plugin reconciliation') .action(reconcilePluginDeps); program.parse(process.argv);