Reshuffle Open Source on Google App Engine
Reshuffle Open Source on Google App Engine
This tutorial describes how to use the gcloud command line interface to deploy a Node.js application.
Prerequisites
gcloud
command-line tool- Google Cloud Platform billing account
Steps to Deploy
- Update the Cloud SDK
$ gcloud components update
- Login to your Google account
$ gcloud auth login
- Create a new project
$ gcloud projects create [YOUR_PROJECT_ID] --set-as-default
Replace[YOUR_PROJECT_ID]
with a string of characters that uniquely identifies your project. - Verify that the project was created
$ gcloud projects describe [YOUR_PROJECT_ID]
- Initialize your App Engine app with your project and choose its region
$ gcloud app create --project=[YOUR_PROJECT_ID]
Make sure billing is enabled for your project. A billing account needs to be linked to your project in order for the application to be deployed to App Engine. - Deploy the app
Change to the project directory and add an app.yaml file with the service’s configuration. As an example you can just add the following line, this will result in an automatic scaling service.
runtime: nodejs12
Deploy the app by running:$ gcloud app deploy
- View the live app at
https://PROJECT_ID.REGION_ID.r.appspot.com
or type$ gcloud app browse
- Cleanup
Delete the project from Google App Engine
$ gcloud projects delete [YOUR_PROJECT_ID]
Read more details about deleting a project
The above example is for automatic scaling, such a service can not be shutdown without a configuration change. For a manual scaling service, change the yaml file and deploy the app. The following is an example for a manual scaling configuration:
runtime: nodejs
env: flex
manual_scaling:
instances: 1
More details can be found in the following links: 1. Quickstart 2. gcloud reference