OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is govered by a BSD-style |
| 3 # license that can be found in the LICENSE file or at |
| 4 # https://developers.google.com/open-source/licenses/bsd |
| 5 |
| 6 # Makefile to simplify some common AppEngine actions. |
| 7 # Use 'make help' for a list of commands. |
| 8 |
| 9 STAGEID= monorail-staging |
| 10 PRODID= monorail-prod |
| 11 |
| 12 GAE_PY?= python gae.py |
| 13 DEV_APPSERVER_FLAGS?= |
| 14 |
| 15 FRONTEND_MODULES?= default |
| 16 BACKEND_MODULES?= besearch |
| 17 |
| 18 default: help |
| 19 |
| 20 check: |
| 21 ifndef NPM_VERSION |
| 22 $(error npm not found. Install from nodejs.org or see README) |
| 23 endif |
| 24 |
| 25 help: |
| 26 @echo "Available commands:" |
| 27 @sed -n '/^[a-zA-Z0-9_.]*:/s/:.*//p' <Makefile |
| 28 |
| 29 test: |
| 30 ../../test.py test appengine/monorail |
| 31 |
| 32 # Commands for running locally using dev_appserver. |
| 33 serve: |
| 34 @echo "---[Starting SDK AppEngine Server]---" |
| 35 $(GAE_PY) devserver $(DEV_APPSERVER_FLAGS) |
| 36 |
| 37 serve_email: |
| 38 @echo "---[Starting SDK AppEngine Server]---" |
| 39 $(GAE_PY) devserver $(DEV_APPSERVER_FLAGS) --enable_sendmail=True |
| 40 |
| 41 # The _remote commands expose the app on 0.0.0.0, so that it is externally |
| 42 # accessible by hostname:port, rather than just localhost:port. |
| 43 serve_remote: |
| 44 @echo "---[Starting SDK AppEngine Server]---" |
| 45 $(GAE_PY) devserver -o $(DEV_APPSERVER_FLAGS) |
| 46 |
| 47 serve_remote_email: |
| 48 @echo "---[Starting SDK AppEngine Server]---" |
| 49 $(GAE_PY) devserver -o $(DEV_APPSERVER_FLAGS) --enable_sendmail=True |
| 50 |
| 51 run: serve |
| 52 |
| 53 |
| 54 # AppEngine apps can be tested locally and in non-default versions upload to |
| 55 # the main app-id, but it is still sometimes useful to have a completely |
| 56 # separate app-id. E.g., for testing inbound email, load testing, or using |
| 57 # throwaway databases. |
| 58 deploy_staging: |
| 59 @echo "---[Staging $(STAGEID)]---" |
| 60 $(GAE_PY) upload -A $(STAGEID) $(FRONTEND_MODULES) $(BACKEND_MODULES) |
| 61 |
| 62 |
| 63 # This is our production server that users actually use. |
| 64 deploy_prod: |
| 65 @echo "---[Deploying prod instance $(PRODID)]---" |
| 66 $(GAE_PY) upload -A $(PRODID) $(FRONTEND_MODULES) $(BACKEND_MODULES) |
| 67 |
| 68 |
| 69 # Note that we do not provide a command-line way to make the newly-uploaded |
| 70 # version the default version. This is for two reasons: a) You should be using |
| 71 # your browser to confirm that the new version works anyway, so just use the |
| 72 # console interface to make it the default; and b) If you really want to use |
| 73 # the command line you can use gae.py directly. |
OLD | NEW |