fd72a50e29
Sample usage: ~/mitm-gerrit/mitm-theme.sh ./path/to/theme.html Change-Id: I9c445d5c8354952771d73b1de0a29626787c8634 |
||
---|---|---|
.. | ||
add-header.py | ||
dev-chrome.sh | ||
force-version.py | ||
mitm-docker.sh | ||
mitm-plugins.sh | ||
mitm-serve-app-dev.sh | ||
mitm-single-plugin.sh | ||
mitm-theme.sh | ||
README.md | ||
serve-app-dev.py | ||
serve-app-locally.py |
Scripts for PolyGerrit local development against prod using MitmProxy.
Installation (OSX)
- Install Docker from http://docker.com
- Start the proxy and create a new proxied browser instance
cd ~/gerrit ~/mitm-gerrit/mitm-serve-app-dev.sh
- Install MITM certificates
- Open http://mitm.it in the proxied browser window
- Follow the instructions to install MITM certs
Usage
Add or replace a single plugin containing static content
To develop unminified plugin that loads multiple files, use this.
- Create a new proxied browser window and start mitmproxy via Docker:
~/mitm-gerrit/mitm-single-plugin.sh ./path/to/static/plugin.html
- Open any *.googlesource.com domain in proxied window
- plugin.html and ./path/to/static/* will be served
Add or replace a minified plugin for *.googlesource.com
This flow assumes no additional .html/.js are needed, i.e. the plugin is a single file.
- Create a new proxied browser window and start mitmproxy via Docker:
~/mitm-gerrit/mitm-plugins.sh ./path/to/plugin.html,./maybe/one/more.js
- Open any *.googlesource.com domain in proxied window
- plugin.html and more.js are served
Force or replace default site theme for *.googlesource.com
- Create a new proxied browser window and start mitmproxy via Docker:
~/mitm-gerrit/mitm-theme.sh ./path/to/theme.html
- Open any *.googlesource.com domain in proxied window
- Default site themes are enabled.
- Local
theme.html
content replaces/static/gerrit-theme.html
/static/*
URLs are served from local theme directory, i.e../path/to/
Serve uncompiled PolyGerrit
- Create a new proxied browser window and start mitmproxy via Docker:
cd ~/gerrit ~/mitm-gerrit/mitm-serve-app-dev.sh
- Open any *.googlesource.com domain in proxied window
- Instead of prod UI (gr-app.html, gr-app.js), local source files will be served