GoogleChromeLabs / lighthousebot

Run Lighthouse in CI, as a web service, using Docker. Pass/Fail GH pull requests.
Apache License 2.0
2.24k stars 127 forks source link

Submit lighthouse_ci to Docker hub? #4

Open kmturley opened 7 years ago

kmturley commented 7 years ago

Great work, this tool will be extremely useful for CI builds!

I see you already have Docker source code here: https://github.com/ebidel/lighthouse-ci/tree/master/builder

Can you submit an official Docker built image to Docker hub? There are a couple of benefits to this approach:

1) This will save everyone the step of downloading and building themselves, and provide an official release which is testable.

2) When using with CI tools, not only does it saves build times, but can be spun up as a service with one line of code, like this selenium example for gitlab and bitbucket pipelines:

.gitlab-ci.yml

test_functional:
  image: python
  stage: test
  services:
    - selenium/standalone-chrome
  script:
    - SELENIUM="http://selenium__standalone-chrome:4444/wd/hub" BASE_URL="https://$CI_BUILD_REF_SLUG-dot-$GAE_PROJECT.appspot.com" DRIVER="headless_chrome" python -m unittest discover -s qa

bitbucket-pipelines.yml

pipelines:
  default:
    - step:
        services:
          - selenium
        script:
          - SELENIUM="http://127.0.0.1:4444/wd/hub" BASE_URL="http://$BITBUCKET_BRANCH.$AWS_PROJECT.us-east-1.elasticbeanstalk.com" DRIVER="headless_chrome" python -m unittest discover -s qa

definitions:
  services:
    selenium:
      image: selenium/standalone-chrome
ebidel commented 7 years ago

Docker noob here :) Do people not pre-build images and reference/use them from CI env? Or is it come to pull from the registry and build every time?

kmturley commented 7 years ago

You can do it either way. But if you pre-build yourself you either need to commit the entire source-code somewhere in your file/folder structure, or need to push the built image to hosting somewhere.

By building an official image, you can save everyone the trouble and makes everything alot easier!

I haven't completed the full steps myself, but I believe you connect Docker Hub to your github, and it builds and hosts the images automatically: https://docs.docker.com/docker-hub/builds/

ebidel commented 7 years ago

Thanks for the link. I'll take a look.

On Thu, Jun 29, 2017 at 12:42 PM Kim T notifications@github.com wrote:

You can do it either way. But if you pre-build yourself you either need to commit the entire source-code somewhere in your file/folder structure, or need to push the built image to hosting somewhere.

By building an official image, you can save everyone the trouble and makes everything alot easier!

I haven't completed the full steps myself, but I believe you connect Docker Hub to your github, and it builds and hosts the images automatically: https://docs.docker.com/docker-hub/builds/

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ebidel/lighthouse-ci/issues/4#issuecomment-312082448, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOigNV-LPmMZhW3BkR3UyHT75H1-Oaaks5sI_4-gaJpZM4OJjot .

kmturley commented 7 years ago

I went ahead and created an example build: https://hub.docker.com/r/kmturley/lighthouse-ci/

My Docker image uses a fork of your repo, and doesn't update when you push new updates, so would recommend you setting this up! It was pretty easy (about 15 minutes)

ebidel commented 7 years ago

Cool thank you. I was on vacation and havent had the time to look into pushing this up to Docker, but will after I catch up on work stuff :)

On Tue, Aug 1, 2017 at 3:22 PM Kim T notifications@github.com wrote:

I went ahead and created an example build: https://hub.docker.com/r/kmturley/lighthouse-ci/

My Docker image uses a fork of your repo, and doesn't update when you push new updates, so would recommend you setting this up! It was pretty easy (about 15 minutes)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ebidel/lighthouse-ci/issues/4#issuecomment-319513991, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOigKsfVXqsB2Gc5O-wggGBscVAXNNXks5sT6UYgaJpZM4OJjot .

igrigorik commented 7 years ago

My Docker image uses a fork of your repo, and doesn't update when you push new updates, so would recommend you setting this up! It was pretty easy (about 15 minutes)

Would love to see this. Please! :-)

pavelloz commented 5 years ago

I'm also interested in that feature to avoid unnecessary building steps on CI.

moberemk commented 5 years ago

Could this be done? This issue has been open for quite a while, and now it might even be doable via Github Actions

staabm commented 5 years ago

using this bot via github actions would have the benefit that we would not need to add the lighthouse bot as a external collaborator, I guess. (external collaborators cost a seat as far as licensing on github side is a concern)

bizmate commented 4 years ago

An update on this would be nice. Building a local image is an extra effort that would be nice to avoid