mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
This commit is contained in:
parent
f0b3dc2211
commit
e3922c6e4e
@ -130,7 +130,7 @@ const packagePluginRunner: TaskRunner<PluginCIOptions> = async () => {
|
|||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
const ciDir = getCiFolder();
|
const ciDir = getCiFolder();
|
||||||
const packagesDir = path.resolve(ciDir, 'packages');
|
const packagesDir = path.resolve(ciDir, 'packages');
|
||||||
let distDir = path.resolve(ciDir, 'dist');
|
const distDir = path.resolve(ciDir, 'dist');
|
||||||
const docsDir = path.resolve(ciDir, 'docs');
|
const docsDir = path.resolve(ciDir, 'docs');
|
||||||
const grafanaEnvDir = path.resolve(ciDir, 'grafana-test-env');
|
const grafanaEnvDir = path.resolve(ciDir, 'grafana-test-env');
|
||||||
await execa('rimraf', [packagesDir, distDir, grafanaEnvDir]);
|
await execa('rimraf', [packagesDir, distDir, grafanaEnvDir]);
|
||||||
@ -139,7 +139,7 @@ const packagePluginRunner: TaskRunner<PluginCIOptions> = async () => {
|
|||||||
|
|
||||||
// Updating the dist dir to have a pluginId named directory in it
|
// Updating the dist dir to have a pluginId named directory in it
|
||||||
// The zip needs to contain the plugin code wrapped in directory with a pluginId name
|
// The zip needs to contain the plugin code wrapped in directory with a pluginId name
|
||||||
distDir = path.resolve(ciDir, `dist/${getPluginId()}`);
|
const distContentDir = path.resolve(distDir, getPluginId());
|
||||||
fs.mkdirSync(grafanaEnvDir);
|
fs.mkdirSync(grafanaEnvDir);
|
||||||
|
|
||||||
console.log('Build Dist Folder');
|
console.log('Build Dist Folder');
|
||||||
@ -147,7 +147,7 @@ const packagePluginRunner: TaskRunner<PluginCIOptions> = async () => {
|
|||||||
// 1. Check for a local 'dist' folder
|
// 1. Check for a local 'dist' folder
|
||||||
const d = path.resolve(process.cwd(), 'dist');
|
const d = path.resolve(process.cwd(), 'dist');
|
||||||
if (fs.existsSync(d)) {
|
if (fs.existsSync(d)) {
|
||||||
await execa('cp', ['-rn', d + '/.', distDir]);
|
await execa('cp', ['-rn', d + '/.', distContentDir]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Look for any 'dist' folders under ci/job/XXX/dist
|
// 2. Look for any 'dist' folders under ci/job/XXX/dist
|
||||||
@ -156,7 +156,7 @@ const packagePluginRunner: TaskRunner<PluginCIOptions> = async () => {
|
|||||||
const contents = path.resolve(ciDir, 'jobs', j, 'dist');
|
const contents = path.resolve(ciDir, 'jobs', j, 'dist');
|
||||||
if (fs.existsSync(contents)) {
|
if (fs.existsSync(contents)) {
|
||||||
try {
|
try {
|
||||||
await execa('cp', ['-rn', contents + '/.', distDir]);
|
await execa('cp', ['-rn', contents + '/.', distContentDir]);
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
throw new Error('Duplicate files found in dist folders');
|
throw new Error('Duplicate files found in dist folders');
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ const packagePluginRunner: TaskRunner<PluginCIOptions> = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log('Save the source info in plugin.json');
|
console.log('Save the source info in plugin.json');
|
||||||
const pluginJsonFile = path.resolve(distDir, 'plugin.json');
|
const pluginJsonFile = path.resolve(distContentDir, 'plugin.json');
|
||||||
const pluginInfo = getPluginJson(pluginJsonFile);
|
const pluginInfo = getPluginJson(pluginJsonFile);
|
||||||
pluginInfo.info.build = await getPluginBuildInfo();
|
pluginInfo.info.build = await getPluginBuildInfo();
|
||||||
fs.writeFile(pluginJsonFile, JSON.stringify(pluginInfo, null, 2), err => {
|
fs.writeFile(pluginJsonFile, JSON.stringify(pluginInfo, null, 2), err => {
|
||||||
|
Loading…
Reference in New Issue
Block a user