-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Olivier Tassinari <[email protected]> Co-authored-by: Jan Potoms <[email protected]>
- Loading branch information
1 parent
2b9d168
commit 6188e51
Showing
25 changed files
with
20,397 additions
and
15,985 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.cache | ||
/.git | ||
/contributor-dashboard-legacy/ | ||
/tools-public/toolpad/.generated/ | ||
/tools-public/toolpad/**/*.yml | ||
build | ||
node_modules | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
/tools-public/toolpad/**/*.yml | ||
/tools-public/toolpad/.generated/ | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
contributor-dashboard-legacy/functions/circle-ci-artifacts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
async function fetchCircleCIApiV2(endpoint) { | ||
const url = `https://circleci.com/api/v2/${endpoint}`; | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(url); | ||
const response = await fetch(url); | ||
const json = await response.json(); | ||
return json; | ||
} | ||
|
||
/** | ||
* netlify function that wraps CircleCI API v2 which requires authentification. | ||
* | ||
* @param {*} event | ||
* @param {*} context | ||
*/ | ||
exports.handler = async function circleCIArtefact(event) { | ||
const { queryStringParameters } = event; | ||
|
||
const buildNumberParameter = queryStringParameters.buildNumber; | ||
const buildNumber = parseInt(buildNumberParameter, 10); | ||
if (Number.isNaN(buildNumber)) { | ||
return { | ||
statusCode: 500, | ||
body: JSON.stringify( | ||
`Given query param buildNumber is not a number. Received '${buildNumberParameter}'.`, | ||
), | ||
}; | ||
} | ||
// eslint-disable-next-line no-console | ||
console.log(`fetching details for job #${buildNumber}`); | ||
|
||
const artifacts = await fetchCircleCIApiV2( | ||
`project/github/mui/material-ui/${buildNumber}/artifacts`, | ||
); | ||
const response = { | ||
statusCode: 200, | ||
body: JSON.stringify(artifacts), | ||
}; | ||
|
||
return response; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
[build] | ||
functions = "functions" | ||
base = "contributor-dashboard-legacy" | ||
|
||
# Directory (relative to root of your repo) that contains the deploy-ready | ||
# HTML files and assets generated by the build. If a base directory has | ||
# been specified, include it in the publish directory path. | ||
publish = "build" | ||
|
||
# Default build command. | ||
command = "pnpm build" | ||
|
||
[build.environment] | ||
NODE_VERSION = "18" | ||
PNPM_FLAGS = "--ignore-workspace" | ||
|
||
[functions] | ||
directory = "functions" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.