Components: Automatically create a live preview for every PR

Created on 27 May 2016  路  4Comments  路  Source: angular/components

It might be a firebase server, or AppEngine. I would consider building a docker on Travis as a Part I and then sending that docker to a server as Part 2.

P5 dev-infra feature

Most helpful comment

Here is a live preview, how it currently looks like.

It has a build time of ~1-2 minutes (_minus_ wasted time for manually executing the hook).

Notice, how the bot posts the link of the automatically built preview. (Message is just temporary)

All 4 comments

One possible approach:
1) Add GitHub hook to remote server when a PR is opened / updated
2) Remote server pulls the PR, builds, copies build output to a directory and serves it.
3) Bot posts to the PR with a link to the preview

Note that any servers being used need to be administered by the Angular team, so any community contribution here would be more about the tooling involved.

So, I'm working on this issue.

The following steps will be executed:

  • Waiting for Github Webhooks
  • Applies PR patch to a extra branch for the PR (preview/pr-517)
  • Builds Distribution with Angular CLI
  • Bundles required dependencies into a bundle (accelerates firebase deploy and load time significant)
  • Modifies the index.html with a virtual DOM, to use the bundle file.
  • Removes unnecessary vendors (e.g 麓@angular` - it's now in the bundle)
  • Deploys new change to the Firebase Hosting
  • Post's link to the PR preview to the PR.

I've already finished this and it's working very well.

I saved a lot of time, by building / enhancing the internal Angular Bot for Material 1 (in progress)

Little Preview of PR #517 (automatically generated)

@jelbourn If you wan't to chat about the implementation or how we should continue, let me know :)

Here is a live preview, how it currently looks like.

It has a build time of ~1-2 minutes (_minus_ wasted time for manually executing the hook).

Notice, how the bot posts the link of the automatically built preview. (Message is just temporary)

@DevVersion wow, that was fast.

Bundles required dependencies into a bundle (accelerates firebase deploy and load time significant)

Are you just running npm install on each PR to get the latest clean dependencies?

Overall sounds great. Once you make a PR, I can spin up a new firebase instance and we can simply point the code to that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MurhafSousli picture MurhafSousli  路  3Comments

kara picture kara  路  3Comments

constantinlucian picture constantinlucian  路  3Comments

RoxKilly picture RoxKilly  路  3Comments

dzrust picture dzrust  路  3Comments