Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ Follow these steps to set up the development environment for the Kata Containers

Create the .env file:
```bash
NODE_ENV=development
TOKEN=<GITHUB_PAT_OR_OTHER_VALID_TOKEN>
```

Create the folder /localData. Then, run:

```bash
node scripts/fetch-ci-nightly-data.js > localData/job_stats.json
NODE_ENV=development node scripts/fetch-ci-nightly-data.js > localData/job_stats.json
npm run dev # On Windows, run `npm run win-dev` instead.
```
The app will be available at [http://localhost:3000](http://localhost:3000).
Expand All @@ -109,4 +108,4 @@ env:
NEXT_PUBLIC_BASE_PATH: ${{ vars.NEXT_PUBLIC_BASE_PATH }}
```
If the variable is undefined, it will use "" for the basePath and assume the site is being served at root.
This makes it easier for people to fork the repo and deploy with GitHub pages such that they can have a preview for their PR.
This makes it easier for people to fork the repo and deploy with GitHub pages such that they can have a preview for their PR.
13 changes: 4 additions & 9 deletions scripts/fetch-ci-nightly-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@
// entry is information about a job and how it has performed over the last
// few runs (e.g. pass or fail).
//
// To run locally:
// node --require dotenv/config scripts/fetch-ci-nightly-data.js
//
// .env file with:
// NODE_ENV=development
// TOKEN=token <GITHUB_PAT_OR_OTHER_VALID_TOKEN>
const dotenv = require("dotenv");

// Set token used for making Authorized GitHub API calls.
// In dev, set by .env file; in prod, set by GitHub Secret.
if(process.env.NODE_ENV === "development"){
require('dotenv').config();
dotenv.config();
}
const TOKEN = process.env.TOKEN;

Expand All @@ -42,7 +37,7 @@ const main_branch_url = "https://api.github.com/repos/" +
"kata-containers/kata-containers/branches/main";

// The number of jobs to fetch from the github API on each paged request.
const jobs_per_request = 100;
const jobs_per_request = 50;

// Count of the number of fetches.
let fetch_count = 0;
Expand Down Expand Up @@ -92,7 +87,7 @@ function get_job_data(run) {
});

if (!response.ok) {
throw new Error(`Failed to fetch jobs: ${response.status}: ` +
throw new Error(`Failed to fetch jobs from ${jobs_url}: ${response.status}: ` +
`${response.statusText}`);
}
const json = await response.json();
Expand Down
Loading