I/O Web App 2015
gcloud components update app).
appcomponent are installed, you'll need to do a one-off configuration by executing the following command:
gcloud config set project. Project ID can be any non-empty string if you just want to run the app locally.
git clone https://github.com/GoogleChrome/ioweb2015.git
If you plan on modifying source code, be a good citizen and:
gulp serveto start a standalone backend, while still enjoying live-reload. You'll need Go for that.
Normally the app is running in "dev" environment but you can change that by providing
--envargument to the gulp task:
# run in dev mode, default: gulp serve # set app environment to production: gulp serve --env prod # or run as if we were in staging: gulp serve --env stage
Not that this does not change the way the backend code is compiled or the front-end is built. It merely changes a variable values, which the app takes into account when rendering a page or responding to a request.
prodrequires real credentials when accessing external services. You'll need to run a one-off
gulp decryptwhich will decrypt a service account private key.
You can also use GAE dev appserver by running
gulp serve:gae. This is closer to what we're using in our webapp environment but a bit slower on startup. You'll need
appcomponent to do this.
To change the app environment when using GAE SDK, provide
# run in dev mode, default: gulp serve:gae # set app environment to production: gulp serve:gae --env prod # or run as if we were in staging: gulp serve:gae --env stage
Other arguments are:
--no-watchdon't watch for file changes and recompile relative bits.
--openopen serving url in a new browser tab on start.
--reloadenable live reload. Always watches for file changes;
--no-watchwill have no effect.
gulp. This will create
distdirectory with both front-end and backend parts, ready for deploy.
Note: Build won't succeed if either
gulp jscsreports errors.
You can also serve the build from
gulp serve:dist, and navigating to http://localhost:8080.
serve:distruns the app in
prodmode by default. You can change that by providing the
--envargument as with other
servetasks. For instance:
# run in stage instead of prod gulp serve:dist --env stage
To deploy complete application on App Engine:
gulpwhich will build both frontend and backend in
gcloud preview app deploy dist/backend --version.
The app will be deployed to the project configured in
gcloudtool. To check which project you're deploying to, run
gcloud config listand look for
project = ...line.
Backend is written in Go. It can run on either Google App Engine or any other platform as a standalone binary program.
gulp backendwill build a self-sufficient backend server and place the binary in
gulp backend:testwill run backend server tests. If, while working on the backend, you feel tired of running the command again and again, use
gulp backend:test --watchto watch for file changes and re-run tests automatically.
--gaecmd line argument to the test task to run GAE-based tests.
A list of tools to help in a debugging process. NOT available in prod
The backend will GET
some-urland respond back with the original status code, content-type header and the content.
Useful for browsing original CMS data on staging GCS bucket:
Follow instructions on that page.
On staging server this is go/iowastaging/debug/push
Frontend tests are run via https://github.com/Polymer/web-component-tester
Configuration is in wct.conf.js.
To run tests, install wct globally:
npm install -g web-component-tester