Toolkit: wrap plugin signing stub with error checking (#22626)

This commit is contained in:
Ryan McKinley 2020-03-06 10:51:48 -08:00 committed by GitHub
parent aa7e6cf55f
commit 46fcf9bf08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -39,7 +39,8 @@ const manifestRunner: TaskRunner<ManifestOptions> = async ({ folder }) => {
// Call a signing service
const GRAFANA_API_KEY = process.env.GRAFANA_API_KEY;
if (GRAFANA_API_KEY) {
const plugin = require('plugin.json');
const pluginPath = path.join(folder, 'plugin.json');
const plugin = require(pluginPath);
const url = `https://grafana.com/api/plugins/${plugin.id}/sign`;
console.log(`TODO: sign and save: ${url}`);
}

View File

@ -168,7 +168,11 @@ const packagePluginRunner: TaskRunner<PluginCIOptions> = async () => {
});
// Write a manifest.txt file in the dist folder
try {
await execTask(manifestTask)({ folder: distContentDir });
} catch (err) {
console.warn(`Error signing manifest: ${distContentDir}`, err);
}
console.log('Building ZIP');
let zipName = pluginInfo.id + '-' + pluginInfo.info.version + '.zip';