Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
e9c1b8b3
Unverified
Commit
e9c1b8b3
authored
Aug 28, 2019
by
Ryan McKinley
Committed by
GitHub
Aug 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
@grafana/toolkit: add package versions to the ci report (#18751)
parent
5fcbc337
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
+31
-4
packages/grafana-toolkit/src/cli/tasks/plugin.ci.ts
+3
-1
packages/grafana-toolkit/src/plugins/env.ts
+11
-2
packages/grafana-toolkit/src/plugins/types.ts
+2
-1
packages/grafana-toolkit/src/plugins/utils.ts
+15
-0
No files found.
packages/grafana-toolkit/src/cli/tasks/plugin.ci.ts
View file @
e9c1b8b3
...
...
@@ -9,7 +9,7 @@ import { PluginMeta } from '@grafana/ui';
import
execa
=
require
(
'execa'
);
import
path
=
require
(
'path'
);
import
fs
from
'fs'
;
import
{
getPackageDetails
,
findImagesInFolder
,
appendPluginHistory
}
from
'../../plugins/utils'
;
import
{
getPackageDetails
,
findImagesInFolder
,
appendPluginHistory
,
getGrafanaVersions
}
from
'../../plugins/utils'
;
import
{
job
,
getJobFolder
,
...
...
@@ -318,6 +318,7 @@ const pluginReportRunner: TaskRunner<PluginCIOptions> = async ({ upload }) => {
const
pluginJsonFile
=
path
.
resolve
(
ciDir
,
'dist'
,
'plugin.json'
);
console
.
log
(
'Load info from: '
+
pluginJsonFile
);
const
pluginMeta
=
getPluginJson
(
pluginJsonFile
);
const
report
:
PluginBuildReport
=
{
plugin
:
pluginMeta
,
...
...
@@ -326,6 +327,7 @@ const pluginReportRunner: TaskRunner<PluginCIOptions> = async ({ upload }) => {
coverage
:
agregateCoverageInfo
(),
tests
:
agregateTestInfo
(),
artifactsBaseURL
:
await
getCircleDownloadBaseURL
(),
grafanaVersion
:
getGrafanaVersions
(),
};
const
pr
=
getPullRequestNumber
();
if
(
pr
)
{
...
...
packages/grafana-toolkit/src/plugins/env.ts
View file @
e9c1b8b3
...
...
@@ -23,12 +23,21 @@ export const job = process.env.CIRCLE_JOB || getJobFromProcessArgv();
export
const
getPluginBuildInfo
=
async
():
Promise
<
PluginBuildInfo
>
=>
{
if
(
process
.
env
.
CIRCLE_SHA1
)
{
return
Promise
.
resolve
(
{
const
info
:
PluginBuildInfo
=
{
time
:
Date
.
now
(),
repo
:
process
.
env
.
CIRCLE_REPOSITORY_URL
,
branch
:
process
.
env
.
CIRCLE_BRANCH
,
hash
:
process
.
env
.
CIRCLE_SHA1
,
});
};
const
pr
=
getPullRequestNumber
();
const
build
=
getBuildNumber
();
if
(
pr
)
{
info
.
pr
=
pr
;
}
if
(
build
)
{
info
.
number
=
build
;
}
return
Promise
.
resolve
(
info
);
}
const
branch
=
await
execa
(
'git'
,
[
'rev-parse'
,
'--abbrev-ref'
,
'HEAD'
]);
const
hash
=
await
execa
(
'git'
,
[
'rev-parse'
,
'HEAD'
]);
...
...
packages/grafana-toolkit/src/plugins/types.ts
View file @
e9c1b8b3
import
{
PluginMeta
,
PluginBuildInfo
}
from
'@grafana/ui'
;
import
{
DataFrame
}
from
'@grafana/data'
;
import
{
DataFrame
,
KeyValue
}
from
'@grafana/data'
;
export
interface
PluginPackageDetails
{
plugin
:
ZipFileInfo
;
...
...
@@ -14,6 +14,7 @@ export interface PluginBuildReport {
tests
:
TestResultsInfo
[];
pullRequest
?:
number
;
artifactsBaseURL
?:
string
;
grafanaVersion
?:
KeyValue
<
string
>
;
}
export
interface
JobInfo
{
...
...
packages/grafana-toolkit/src/plugins/utils.ts
View file @
e9c1b8b3
import
execa
from
'execa'
;
import
path
from
'path'
;
import
fs
from
'fs'
;
import
{
KeyValue
}
from
'@grafana/data'
;
import
{
PluginDevInfo
,
ExtensionSize
,
ZipFileInfo
,
PluginBuildReport
,
PluginHistory
}
from
'./types'
;
const
md5File
=
require
(
'md5-file'
);
export
function
getGrafanaVersions
():
KeyValue
<
string
>
{
const
dir
=
path
.
resolve
(
process
.
cwd
(),
'node_modules'
,
'@grafana'
);
const
versions
:
KeyValue
=
{};
try
{
fs
.
readdirSync
(
dir
).
forEach
(
file
=>
{
const
json
=
require
(
path
.
resolve
(
dir
,
file
,
'package.json'
));
versions
[
file
]
=
json
.
version
;
});
}
catch
(
err
)
{
console
.
warn
(
'Error reading toolkit versions'
,
err
);
}
return
versions
;
}
export
function
getFileSizeReportInFolder
(
dir
:
string
,
info
?:
ExtensionSize
):
ExtensionSize
{
const
acc
:
ExtensionSize
=
info
?
info
:
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment