Skip to content

Commit

Permalink
Eslint and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Oct 7, 2018
1 parent bdee36c commit f5e3921
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ By default, these scripts deploy to [Google App Engine Flexible containers](http

Deploy the frontend:

./deploy.sh YYYY-MM-DD frontend
npm run deploy YYYY-MM-DD frontend

Deploy the CI builder backend:

./deploy.sh YYYY-MM-DD builder
npm run deploy YYYY-MM-DD builder

## FAQ

Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"author": "Eric Bidelman <ebidel@>",
"license": "Apache-2.0",
"description": "Lighthouse CI Runner",
"main": "runlighthouse.js",
"bin": {
"lighthouse-ci": "runlighthouse.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ebidel/lighthouse-ci.git"
Expand All @@ -16,6 +12,13 @@
"url": "https://github.com/ebidel/lighthouse-ci/issues"
},
"homepage": "https://github.com/ebidel/lighthouse-ci#readme",
"main": "runlighthouse.js",
"bin": {
"lighthouse-ci": "runlighthouse.js"
},
"scripts": {
"deploy": "./deploy.sh"
},
"dependencies": {
"minimist": "^1.2.0",
"node-fetch": "^2.2.0"
Expand Down
29 changes: 15 additions & 14 deletions runlighthouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const API_KEY = process.env.LIGHTHOUSE_API_KEY || process.env.API_KEY;
const RUNNERS = {chrome: 'chrome', wpt: 'wpt'};

if (process.env.API_KEY) {
console.log('Warning: The environment variable API_KEY is deprecated. Please use LIGHTHOUSE_API_KEY instead.');
console.log(`Warning: The environment variable API_KEY is deprecated.
Please use LIGHTHOUSE_API_KEY instead.`);
}

function printUsageAndExit() {
Expand Down Expand Up @@ -91,7 +92,7 @@ function getConfig() {
const possibleRunners = Object.keys(RUNNERS);
if (!possibleRunners.includes(config.runner)) {
console.log(
`Unknown runner "${config.runner}". Options: ${possibleRunners}`);
`Unknown runner "${config.runner}". Options: ${possibleRunners}`);
printUsageAndExit();
}
console.log(`Using runner: ${config.runner}`);
Expand Down Expand Up @@ -131,19 +132,19 @@ function run(config) {
'Content-Type': 'application/json',
'X-API-KEY': API_KEY
}})
.then(resp => resp.json())
.then(json => {
if (config.runner === RUNNERS.wpt) {
console.log(
.then(resp => resp.json())
.then(json => {
if (config.runner === RUNNERS.wpt) {
console.log(
`Started Lighthouse run on WebPageTest: ${json.data.target_url}`);
return;
}
console.log('Lighthouse CI score:', json.score);
})
.catch(err => {
console.log('Lighthouse CI failed', err);
process.exit(1);
});
return;
}
console.log('Lighthouse CI score:', json.score);
})
.catch(err => {
console.log('Lighthouse CI failed', err);
process.exit(1);
});
}

// Run LH if this is a PR.
Expand Down

0 comments on commit f5e3921

Please sign in to comment.