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
9edd8b7c
Unverified
Commit
9edd8b7c
authored
May 20, 2020
by
Ryan McKinley
Committed by
GitHub
May 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Toolkit: update the artifact download calculation (#24828)
parent
8aedf811
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
packages/grafana-toolkit/src/plugins/env.ts
+7
-11
No files found.
packages/grafana-toolkit/src/plugins/env.ts
View file @
9edd8b7c
...
...
@@ -97,26 +97,22 @@ export const writeJobStats = (startTime: number, workDir: string) => {
});
};
// https://circleci.com/api/v1.1/project/github/NatelEnergy/grafana-discrete-panel/latest/artifacts
export
async
function
getCircleDownloadBaseURL
():
Promise
<
string
|
undefined
>
{
try
{
const
axios
=
require
(
'axios'
);
const
buildNumber
=
getBuildNumber
();
const
repo
=
process
.
env
.
CIRCLE_PROJECT_REPONAME
;
const
user
=
process
.
env
.
CIRCLE_PROJECT_USERNAME
;
let
url
=
`https://circleci.com/api/v1.1/project/github/
${
user
}
/
${
repo
}
/latest/artifacts`
;
const
rsp
=
await
axios
.
get
(
url
);
for
(
const
s
of
rsp
.
data
)
{
let
idx
=
s
.
url
.
indexOf
(
'-'
);
if
(
idx
>
0
)
{
url
=
s
.
url
.
substring
(
idx
);
idx
=
url
.
indexOf
(
'circleci/plugin/ci'
);
if
(
idx
>
0
)
{
url
=
url
.
substring
(
0
,
idx
);
url
=
`https://
${
buildNumber
}${
url
}
circleci/plugin/ci`
;
return
url
;
}
const
{
path
,
url
}
=
s
;
if
(
url
&&
path
&&
path
.
endsWith
(
'report.json'
))
{
return
url
.
substring
(
url
.
length
-
'report.json'
.
length
);
}
}
}
catch
{}
}
catch
(
e
)
{
console
.
log
(
'Error reading CircleCI artifact URL'
,
e
);
}
return
undefined
;
}
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