diff --git a/.gitignore b/.gitignore index 1620057..d67316a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ google-lighthouse-puppeteer-*.tgz -.build -*.yaml +build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7c3fa7d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: required - -services: - - docker - -before_install: - - sudo apt update && sudo apt install make -y - - git clone https://github.com/estesp/manifest-tool && cd manifest-tool && sudo make && sudo make install && cd .. && rm -Rf manifest-tool - - docker run --rm --privileged multiarch/qemu-user-static:register - - sudo apt install -y qemu qemu-user-static qemu-user binfmt-support - -script: - - echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_LOGIN" --password-stdin - - make build-docker - -deploy: - provider: script - script: - - make publish-docker latest - on: - branch: master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9b4c7b5..f77c027 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ How to Contribute This project welcomes your contribution. There are several ways to help out: -* Create an [issue](https://github.com/femtopixel/docker-google-lighthouse-puppeteer/issues/) on GitHub, +* Create an [issue](https://github.com/femtopixel/google-lighthouse-puppeteer/issues/) on GitHub, if you have found a bug or have an idea for a feature * Write test cases for open bug issues * Write patches for open bug/feature issues @@ -14,7 +14,7 @@ chance of keeping on top of things. Issues ------ -* Submit an [issue](https://github.com/femtopixel/docker-google-lighthouse-puppeteer/issues/) +* Submit an [issue](https://github.com/femtopixel/google-lighthouse-puppeteer/issues/) * Make sure it does not already exist. * Clearly describe the issue including steps to reproduce, when it is a bug. * Make sure you note the version you use. @@ -22,6 +22,6 @@ Issues Additional Resources -------------------- -* [Existing issues](https://github.com/femtopixel/docker-google-lighthouse-puppeteer/issues/) +* [Existing issues](https://github.com/femtopixel/google-lighthouse-puppeteer/issues/) * [General GitHub documentation](https://help.github.com/) * [GitHub pull request documentation](https://help.github.com/send-pull-requests/) diff --git a/LICENSE.md b/LICENSE.md index 804bafc..25511ad 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,5 @@ The MIT License (MIT) -Copyright (c) 2017 FemtoPixel +Copyright (c) 2018 FemtoPixel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/Makefile b/Makefile index d935f1a..b6cc653 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,8 @@ -VERSION ?= v4.0.0-alpha.2-3.2.1-v1.11.0-0.3.4 +VERSION ?= 0.4.0 CACHE ?= --no-cache=1 -FULLVERSION ?= v4.0.0-alpha.2-3.2.1-v1.11.0-0.3.4 -archs ?= amd64 i386 arm32v7 +FULLVERSION ?= 0.4.0 .PHONY: install install-npm publish-npm docker build-docker publish-docker latest version -all: install publish docker - CACHE= make latest -docker: build-docker publish-docker +all: install publish CACHE= make latest install: docker run --rm -v `pwd`:/app -ti -w /app node make install-npm @@ -25,17 +22,3 @@ install-npm: clean npm pack publish-npm: install-npm npm login && npm publish -build-docker: - $(foreach arch,$(archs), \ - cat Dockerfile | sed -E "s/FROM femtopixel\/google-lighthouse:(.+)/FROM femtopixel\/google-lighthouse:\1-$(arch)/g" > .build; \ - docker build -t femtopixel/google-lighthouse-puppeteer:${VERSION}-$(arch) --build-arg VERSION=${VERSION}-$(arch) -f .build ${CACHE} .;\ - ) -publish-docker: - docker push femtopixel/google-lighthouse-puppeteer - cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest2.yaml - cat manifest2.yaml | sed "s/\$$FULLVERSION/${FULLVERSION}/g" > manifest.yaml - manifest-tool push from-spec manifest.yaml -latest: build-docker - cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest2.yaml - cat manifest2.yaml | sed "s/\$$FULLVERSION/latest/g" > manifest.yaml - manifest-tool push from-spec manifest.yaml diff --git a/README.md b/README.md index e868837..e4a289d 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ ![logo](logo.png) -Google Lighthouse Puppeteer - Docker Image -========================================== +Lighthouse Puppeteer - NPM Package +================================== -[![latest release](https://img.shields.io/github/release/femtopixel/docker-google-lighthouse-puppeteer.svg "latest release")](http://github.com/femtopixel/docker-google-lighthouse-puppeteer/releases) +[![latest release](https://img.shields.io/github/release/femtopixel/google-lighthouse-puppeteer.svg "latest release")](http://github.com/femtopixel/google-lighthouse-puppeteer/releases) [![NPM release](https://img.shields.io/npm/v/google-lighthouse-puppeteer.svg "NPM release")](https://www.npmjs.com/package/google-lighthouse-puppeteer) -[![Docker Pulls](https://img.shields.io/docker/pulls/femtopixel/google-lighthouse-puppeteer.svg)](https://hub.docker.com/r/femtopixel/google-lighthouse-puppeteer/) -[![Docker Stars](https://img.shields.io/docker/stars/femtopixel/google-lighthouse-puppeteer.svg)](https://hub.docker.com/r/femtopixel/google-lighthouse-puppeteer/) [![Bitcoin donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/btc.png "Bitcoin donation")](https://m.freewallet.org/id/374ad82e/btc) [![Litecoin donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ltc.png "Litecoin donation")](https://m.freewallet.org/id/374ad82e/ltc) [![PayPal donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ppl.png "PayPal donation")](https://www.paypal.me/jaymoulin) @@ -18,38 +16,10 @@ Google Lighthouse Puppeteer - Docker Image Description ----------- -The purpose of this image is to produce performance report for several pages in connected mode and in an automated way to be integrated in a CI environment. +The purpose of this package image is to produce performance report for several pages in connected mode and in an automated (programmated) way. -It uses [lighthouse-batch](https://github.com/mikestead/lighthouse-batch) to be able to automate export of multiple +It uses [lighthouse-batch](https://github.com/mikestead/lighthouse-batch) to be able to automate export of multiple -Docker Usage ------------- - -``` -docker run --rm --name perf -it -v /path/to/your/report/folder:/home/chrome/reports -v /path/to/your/testcases/folder:/home/chrome/testcases --cap-add SYS_ADMIN femtopixel/google-lighthouse-puppeteer -``` - -with `` the name of the test in the `testcases` folder without `.js` - -### Example - -``` -docker run --rm --name perf -it -v /path/to/your/report/folder:/home/chrome/reports -v /path/to/your/testcases/folder:/home/chrome/testcases --cap-add SYS_ADMIN femtopixel/google-lighthouse-puppeteer my_test -``` - - -Docker Usage : Improved ----------------- - -Using the ever-awesome [Jessie Frazelle](https://twitter.com/jessfraz) SECCOMP profile for Chrome, we don't have to use the hammer that is SYS_ADMIN: - -``` -wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json -docker run --rm --name perf -it -v /path/to/your/report/folder:/home/chrome/reports -v /path/to/your/testcases/folder:/home/chrome/testcases --security-opt seccomp=$HOME/chrome.json femtopixel/google-lighthouse-puppeteer -``` - -NodeJS / NPM Package --------------------- ### Installation ``` @@ -167,19 +137,3 @@ class whateverYouWant module.exports = new whateverYouWant(); ``` - - - -FAQ ---- - -* Using `lighthouse` in authenticated mode : https://github.com/GoogleChrome/lighthouse/blob/master/docs/readme.md#testing-on-a-site-with-authentication -* Error while writing files -``` - Runtime error encountered: { Error: EACCES: permission denied, open '/home/chrome/reports/myawesome_site_admin_heavypage.report.json' - errno: -13, - code: 'EACCES', - syscall: 'open', - path: '/home/chrome/reports/myawesome_site_admin_heavypage.report.json' } -``` -Make sure your folder has the write right for others (`chmod o+w`) diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index 8f695c4..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -e - -if [[ -f "/home/chrome/testcases/$1.js" ]]; then - set -- lighthouse-puppeteer "/home/chrome/testcases/$1.js" "${@:2}" -elif [ "${1#-}" != "$1" ]; then - set -- lighthouse-puppeteer "$@" -fi - -exec "$@" - diff --git a/logo.png b/logo.png index 71c8003..86cc9cf 100644 Binary files a/logo.png and b/logo.png differ diff --git a/manifest.yml b/manifest.yml deleted file mode 100644 index 5e435a0..0000000 --- a/manifest.yml +++ /dev/null @@ -1,18 +0,0 @@ -image: femtopixel/google-lighthouse-puppeteer:$FULLVERSION -manifests: - - - image: femtopixel/google-lighthouse-puppeteer:$VERSION-arm32v7 - platform: - architecture: arm - variant: v7 - os: linux - - - image: femtopixel/google-lighthouse-puppeteer:$VERSION-i386 - platform: - architecture: 386 - os: linux - - - image: femtopixel/google-lighthouse-puppeteer:$VERSION-amd64 - platform: - architecture: amd64 - os: linux diff --git a/package.json b/package.json index 1eff603..07ca55c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "google-lighthouse-puppeteer", - "version": "0.3.3", + "version": "0.4.0", "description": "Google Lighthouse Puppeteer is a package to generate reports on multiple urls that allows or not authentication", "main": "lighthouse-puppeteer.js", "scripts": { @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/femtopixel/docker-google-lighthouse-puppeteer.git" + "url": "git+https://github.com/femtopixel/google-lighthouse-puppeteer.git" }, "keywords": [ "google", @@ -21,13 +21,13 @@ "dependencies": { "command-line-args": "^4.0.7", "command-line-usage": "^4.0.1", - "lighthouse-batch": "^2.1.0", + "lighthouse-batch": "^3.0.0", "puppeteer": "^0.13.0" }, "author": "Jay MOULIN (https://jaymoulin.github.io)", "license": "MIT", "bugs": { - "url": "https://github.com/femtopixel/docker-google-lighthouse-puppeteer/issues" + "url": "https://github.com/femtopixel/google-lighthouse-puppeteer/issues" }, - "homepage": "https://github.com/femtopixel/docker-google-lighthouse-puppeteer#readme" + "homepage": "https://github.com/femtopixel/google-lighthouse-puppeteer#readme" }