A simple create-react-app
skeleton app used to test Google App Engine (GAE) deployment, along with Travis CI
- Run
create-react-app hello-world-react
- Install
google cloud sdk
if you prefer deploying using CLI compared to Travis or GAE Dashboard. instructions here! - Create app.yaml for configuring your GAE settings. It can run with minimal settings, no worries!
- Install
travis-cli
if you haven't. The ever fantabulous github repo - Download your GAE App's credential key from Dashboard > API & Services > create credential
- Encrypt GAE App's credential into Travis's .travis.yml using the command
travis encrypt secretCredential.json --add
- Do NOT commit the original credential file
- COMMIT ONLY the generated secretCredential.json.enc file (ignore .enc extension when configuring .travis.yml)
- Log into your Travis Account and link your Github Repository.
- Commit and push your code to automation greatness.
gcloud init
is not a per-project command. It's a global command used to init a new project in GAE, similar to creating a new repository in Git. Once you have created an App using the command, you may build multiple projects in it. (Look at it like a server instance)- Once your service is deployed on GAE using Travis, the old version will be stopped.
- This can be prevented by using
no_stop_previous_version
flag in Travis - If you have two versions of the same service running, you can split traffic in GAE's Dashboard, under Versions. Can be useful for non-demographically targeted AB Testing
- This can be prevented by using
- GAE is PaaS, while Google Compute Engine (GCE) is Iaas. What are the differences?
- For some reason Travis build process is a lot longer than simply running
gcloud app deploy
. It needs to be looked into. - Node JS can only use flexible environment on GAE, which will incur higher cost!