From 36fc37fd0e4d3f0a55d64d329a07fb32678c9923 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Tue, 4 May 2021 10:13:29 -0700 Subject: [PATCH] Toolkit: add deprecation notice to toolkit/ci commands (#33664) --- packages/grafana-toolkit/src/cli/index.ts | 15 ++----- .../src/cli/tasks/plugin.ci.ts | 44 ++++++------------- 2 files changed, 17 insertions(+), 42 deletions(-) diff --git a/packages/grafana-toolkit/src/cli/index.ts b/packages/grafana-toolkit/src/cli/index.ts index 65d6979be84..ec08668a801 100644 --- a/packages/grafana-toolkit/src/cli/index.ts +++ b/packages/grafana-toolkit/src/cli/index.ts @@ -15,7 +15,7 @@ import { closeMilestoneTask } from './tasks/closeMilestone'; import { pluginDevTask } from './tasks/plugin.dev'; import { githubPublishTask } from './tasks/plugin.utils'; import { pluginUpdateTask } from './tasks/plugin.update'; -import { ciBuildPluginDocsTask, ciBuildPluginTask, ciPackagePluginTask, ciPluginReportTask } from './tasks/plugin.ci'; +import { ciBuildPluginTask, ciPackagePluginTask, ciPluginReportTask } from './tasks/plugin.ci'; import { buildPackageTask } from './tasks/package.build'; import { pluginCreateTask } from './tasks/plugin.create'; import { pluginSignTask } from './tasks/plugin.sign'; @@ -210,7 +210,7 @@ export const run = (includeInternalScripts = false) => { .command('plugin:ci-build') .option('--finish', 'move all results to the jobs folder', false) .option('--maxJestWorkers |', 'Limit number of Jest workers spawned') - .description('Build the plugin, leaving results in /dist and /coverage') + .description('[deprecated] Build the plugin, leaving results in /dist and /coverage') .action(async (cmd) => { await execTask(ciBuildPluginTask)({ finish: cmd.finish, @@ -218,19 +218,12 @@ export const run = (includeInternalScripts = false) => { }); }); - program - .command('plugin:ci-docs') - .description('Build the HTML docs') - .action(async (cmd) => { - await execTask(ciBuildPluginDocsTask)({}); - }); - program .command('plugin:ci-package') .option('--signatureType ', 'Signature Type') .option('--rootUrls ', 'Root URLs') .option('--signing-admin', 'Use the admin API endpoint for signing the manifest. (deprecated)', false) - .description('Create a zip packages for the plugin') + .description('[deprecated] Create a zip packages for the plugin') .action(async (cmd) => { await execTask(ciPackagePluginTask)({ signatureType: cmd.signatureType, @@ -240,7 +233,7 @@ export const run = (includeInternalScripts = false) => { program .command('plugin:ci-report') - .description('Build a report for this whole process') + .description('[deprecated] Build a report for this whole process') .option('--upload', 'upload packages also') .action(async (cmd) => { await execTask(ciPluginReportTask)({ diff --git a/packages/grafana-toolkit/src/cli/tasks/plugin.ci.ts b/packages/grafana-toolkit/src/cli/tasks/plugin.ci.ts index 77c96233495..16a4c5d8086 100644 --- a/packages/grafana-toolkit/src/cli/tasks/plugin.ci.ts +++ b/packages/grafana-toolkit/src/cli/tasks/plugin.ci.ts @@ -41,6 +41,10 @@ export interface PluginCIOptions { * * Anything that should be put into the final zip file should be put in: * ~/ci/jobs/build_xxx/dist + * + * @deprecated -- this task was written with a specific circle-ci build in mind. That system + * has been replaced with Drone, and this is no longer the best practice. Any new work + * should be defined in the grafana build pipeline tool or drone configs directly. */ const buildPluginRunner: TaskRunner = async ({ finish, maxJestWorkers }) => { const start = Date.now(); @@ -66,37 +70,6 @@ const buildPluginRunner: TaskRunner = async ({ finish, maxJestW export const ciBuildPluginTask = new Task('Build Plugin', buildPluginRunner); -/** - * 2. Build Docs - * - * Take /docs/* and format it into /ci/docs/HTML site - * - */ -const buildPluginDocsRunner: TaskRunner = async () => { - const docsSrc = path.resolve(process.cwd(), 'docs'); - if (!fs.existsSync(docsSrc)) { - console.log('No docs src'); - return; - } - - const start = Date.now(); - const workDir = getJobFolder(); - await execa('rimraf', [workDir]); - fs.mkdirSync(workDir); - - const docsDest = path.resolve(process.cwd(), 'ci', 'docs'); - fs.mkdirSync(docsDest); - - const exe = await execa('cp', ['-rv', docsSrc + '/.', docsDest]); - console.log(exe.stdout); - - fs.writeFileSync(path.resolve(docsDest, 'index.html'), `TODO... actually build docs`, { encoding: 'utf-8' }); - - writeJobStats(start, workDir); -}; - -export const ciBuildPluginDocsTask = new Task('Build Plugin Docs', buildPluginDocsRunner); - /** * 2. Package * @@ -104,6 +77,11 @@ export const ciBuildPluginDocsTask = new Task('Build Plugin Doc * 1. merge it into: `~/ci/dist` * 2. zip it into packages in `~/ci/packages` * 3. prepare grafana environment in: `~/ci/grafana-test-env` + * + * + * @deprecated -- this task was written with a specific circle-ci build in mind. That system + * has been replaced with Drone, and this is no longer the best practice. Any new work + * should be defined in the grafana build pipeline tool or drone configs directly. */ const packagePluginRunner: TaskRunner = async ({ signatureType, rootUrls }) => { const start = Date.now(); @@ -224,6 +202,10 @@ export const ciPackagePluginTask = new Task('Bundle Plugin', pa * 4. Report * * Create a report from all the previous steps + * + * @deprecated -- this task was written with a specific circle-ci build in mind. That system + * has been replaced with Drone, and this is no longer the best practice. Any new work + * should be defined in the grafana build pipeline tool or drone configs directly. */ const pluginReportRunner: TaskRunner = async ({ upload }) => { const ciDir = path.resolve(process.cwd(), 'ci');