mirror of https://github.com/grafana/grafana
Toolkit: Provide update plugin to allow plugins configuration to normalize (#23540)
* Toolkit: Update plugin added - To normalize an bring a plugins "managed" config up to date * Added changes for filter only release * changed name * updated test for checking files in manifestpull/23559/head
parent
32390c1c39
commit
c5f21bdae9
@ -1,15 +1,12 @@ |
||||
#!/usr/bin/env node
|
||||
|
||||
var path = require('path') ; |
||||
var path = require('path'); |
||||
|
||||
// This bin is used for cli executed internally
|
||||
|
||||
var tsProjectPath = path.resolve(__dirname, '../tsconfig.json'); |
||||
|
||||
require('ts-node').register({ |
||||
project: tsProjectPath, |
||||
transpileOnly: true |
||||
transpileOnly: true, |
||||
}); |
||||
|
||||
|
||||
require('../src/cli/index.ts').run(true); |
||||
|
@ -0,0 +1,23 @@ |
||||
import { Task, TaskRunner } from './task'; |
||||
import { useSpinner } from '../utils/useSpinner'; |
||||
import fs = require('fs'); |
||||
import path = require('path'); |
||||
|
||||
interface UpdatePluginTask {} |
||||
|
||||
const updateCiConfig = useSpinner<any>('Updating CircleCI config', async () => { |
||||
const ciConfigPath = path.join(process.cwd(), '.circleci'); |
||||
if (!fs.existsSync(ciConfigPath)) { |
||||
fs.mkdirSync(ciConfigPath); |
||||
} |
||||
|
||||
const sourceFile = path.join('node_modules/@grafana/toolkit/config/circleci', 'config.yml'); |
||||
const destFile = path.join(ciConfigPath, 'config.yml'); |
||||
fs.copyFileSync(sourceFile, destFile); |
||||
}); |
||||
|
||||
const pluginUpdateRunner: TaskRunner<UpdatePluginTask> = async () => { |
||||
await updateCiConfig({}); |
||||
}; |
||||
|
||||
export const pluginUpdateTask = new Task<UpdatePluginTask>('Update Plugin', pluginUpdateRunner); |
Loading…
Reference in new issue