From 3422ce55fe3b3751d04ce8a95e8090f356d2842f Mon Sep 17 00:00:00 2001 From: rohita77 Date: Sat, 7 Jul 2018 16:35:45 +0800 Subject: [PATCH 01/13] gcloud deployment --- docs/content/deployment/gcloud-deployment.md | 49 ++++++++++++++++++++ docs/content/deployment/index.md | 2 + 2 files changed, 51 insertions(+) create mode 100644 docs/content/deployment/gcloud-deployment.md diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md new file mode 100644 index 000000000..9862c4d95 --- /dev/null +++ b/docs/content/deployment/gcloud-deployment.md @@ -0,0 +1,49 @@ + +The following are the instructions to deploy the angular-fullstack app to Google Cloud App Engine Standard Environment + +# Prequsites +> ## Google Cloud SDK +>> Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) +> ## Create GCP Project +>> `gcloud projects create PROJECT_ID` +> ## Enable Billing +>> `gcloud alpha billing projects link my-project \ + --billing-account 0X0X0X-0X0X0X-0X0X0X` + +> ## Create a MongoDB database +>> Create a MongoDB instance and obtain the uri and credentials + +# Deployment Setup +> ## Set Node / NPM versions +>> GCloud App Engine supports only only for the newest version of Node.js 8 +>> `"engines": { + "node": ">=8.0", + "npm": "^5.1.1" + },` + +> ## Create Application configuration file (app.yaml) +>>A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, scaling, and other general settings including environment variables. + +>> create a 'app.yaml' file with the following contents + +>>> `env: standard` + +>>> `runtime: nodejs8` + +>>> ` ` + +>>> `env_variables:` + +>>> ` MONGODB_URI: "mongodb://:@> ## Add app.yaml to .gitignore + +# Deployment Steps +> ## Build the app +>> `gulp build` +> ## Copy app.yaml to dist +>> `copy app.yaml dist` +> ## Change to build directory +>> `cd dist` +> ## Deploy +>> `gcloud app deploy` \ No newline at end of file diff --git a/docs/content/deployment/index.md b/docs/content/deployment/index.md index 5db3b6880..0160ec3e7 100644 --- a/docs/content/deployment/index.md +++ b/docs/content/deployment/index.md @@ -22,3 +22,5 @@ $ cd myproj 5. ``` $ NODE_ENV=production node ./server ``` + +## [Gcloud App Engine (Standard Environment)](gcloud-deployment.md) \ No newline at end of file From edc25c59c738fc613590b27c676ebce12b0ccf3f Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 16:41:42 +0800 Subject: [PATCH 02/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index 9862c4d95..828274bb4 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -5,7 +5,7 @@ The following are the instructions to deploy the angular-fullstack app to Google > ## Google Cloud SDK >> Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) > ## Create GCP Project ->> `gcloud projects create PROJECT_ID` +... `gcloud projects create PROJECT_ID` > ## Enable Billing >> `gcloud alpha billing projects link my-project \ --billing-account 0X0X0X-0X0X0X-0X0X0X` @@ -46,4 +46,4 @@ The following are the instructions to deploy the angular-fullstack app to Google > ## Change to build directory >> `cd dist` > ## Deploy ->> `gcloud app deploy` \ No newline at end of file +>> `gcloud app deploy` From 0a0ee50d2f645ffb631ee7acfcb8a9afdf63d424 Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 16:42:08 +0800 Subject: [PATCH 03/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index 828274bb4..405250545 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -5,7 +5,9 @@ The following are the instructions to deploy the angular-fullstack app to Google > ## Google Cloud SDK >> Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) > ## Create GCP Project +``` ... `gcloud projects create PROJECT_ID` +``` > ## Enable Billing >> `gcloud alpha billing projects link my-project \ --billing-account 0X0X0X-0X0X0X-0X0X0X` From baa0af223cb159cc41728940d6e407f96abb7e05 Mon Sep 17 00:00:00 2001 From: rohita77 Date: Sat, 7 Jul 2018 17:01:33 +0800 Subject: [PATCH 04/13] gcloud deplyment instructions --- docs/content/deployment/gcloud-deployment.md | 74 +++++++++++--------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index 405250545..9584c8d17 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -2,50 +2,58 @@ The following are the instructions to deploy the angular-fullstack app to Google Cloud App Engine Standard Environment # Prequsites -> ## Google Cloud SDK ->> Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) -> ## Create GCP Project -``` -... `gcloud projects create PROJECT_ID` -``` -> ## Enable Billing ->> `gcloud alpha billing projects link my-project \ + ## 1. Google Cloud SDK + Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) + ## 2. Create GCP Project + `gcloud projects create PROJECT_ID` + ## 3. Enable Billing + `gcloud alpha billing projects link my-project \ --billing-account 0X0X0X-0X0X0X-0X0X0X` -> ## Create a MongoDB database ->> Create a MongoDB instance and obtain the uri and credentials + ## Create a MongoDB database + Create a MongoDB instance and obtain the uri and credentials # Deployment Setup -> ## Set Node / NPM versions ->> GCloud App Engine supports only only for the newest version of Node.js 8 ->> `"engines": { - "node": ">=8.0", + ## 1. Set Node / NPM versions + GCloud App Engine supports only only for the newest version of Node.js 8 + ```json + "engines": { + "node": " =8.0", "npm": "^5.1.1" - },` + },``` -> ## Create Application configuration file (app.yaml) ->>A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, scaling, and other general settings including environment variables. + ## 2. Create Application configuration file (app.yaml) + A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, scaling, and other general settings including environment variables. ->> create a 'app.yaml' file with the following contents + create a 'app.yaml' file with the following contents ->>> `env: standard` + ```json ->>> `runtime: nodejs8` + env: standard ->>> ` ` + runtime: nodejs8 ->>> `env_variables:` + env_variables: + MONGODB_URI: "mongodb://>> ` MONGODB_URI: "mongodb://:@> ## Add app.yaml to .gitignore + ## Add app.yaml to .gitignore # Deployment Steps -> ## Build the app ->> `gulp build` -> ## Copy app.yaml to dist ->> `copy app.yaml dist` -> ## Change to build directory ->> `cd dist` -> ## Deploy ->> `gcloud app deploy` + ## 1. Build the app + ```bash + gulp build + ``` + ## 2. Copy app.yaml to dist + ```bash + copy app.yaml dist + ``` + ## 3. Change to build directory + ```bash + cd dist + ``` + ## 4. Deploy + ```bash + gcloud app deploy + ``` \ No newline at end of file From 096abb2671dc7b55b5b3c3e484b17a21eae4b267 Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 17:06:49 +0800 Subject: [PATCH 05/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index 9584c8d17..b7ebda54a 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -16,11 +16,12 @@ The following are the instructions to deploy the angular-fullstack app to Google # Deployment Setup ## 1. Set Node / NPM versions GCloud App Engine supports only only for the newest version of Node.js 8 - ```json + ```javascript "engines": { "node": " =8.0", "npm": "^5.1.1" - },``` + }, + ``` ## 2. Create Application configuration file (app.yaml) A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, scaling, and other general settings including environment variables. @@ -56,4 +57,4 @@ The following are the instructions to deploy the angular-fullstack app to Google ## 4. Deploy ```bash gcloud app deploy - ``` \ No newline at end of file + ``` From b2dd33e4ace04e09c988ebd4f61c08ed2ed4619f Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 17:07:50 +0800 Subject: [PATCH 06/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index b7ebda54a..3590554a8 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -16,7 +16,7 @@ The following are the instructions to deploy the angular-fullstack app to Google # Deployment Setup ## 1. Set Node / NPM versions GCloud App Engine supports only only for the newest version of Node.js 8 - ```javascript + ```javascript "engines": { "node": " =8.0", "npm": "^5.1.1" From dcd97f0a2adf185e4e6665577a4ce058a2133916 Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 17:08:42 +0800 Subject: [PATCH 07/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index 3590554a8..a90469b3a 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -28,8 +28,8 @@ The following are the instructions to deploy the angular-fullstack app to Google create a 'app.yaml' file with the following contents - ```json - + ```javascript + env: standard runtime: nodejs8 @@ -37,7 +37,7 @@ The following are the instructions to deploy the angular-fullstack app to Google env_variables: MONGODB_URI: "mongodb:// Date: Sat, 7 Jul 2018 17:09:41 +0800 Subject: [PATCH 08/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index a90469b3a..02cc2ced9 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -26,7 +26,7 @@ The following are the instructions to deploy the angular-fullstack app to Google ## 2. Create Application configuration file (app.yaml) A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, scaling, and other general settings including environment variables. - create a 'app.yaml' file with the following contents + 2.1 create a 'app.yaml' file with the following contents ```javascript @@ -39,7 +39,7 @@ The following are the instructions to deploy the angular-fullstack app to Google ``` - ## Add app.yaml to .gitignore + 2.2 Add app.yaml to .gitignore # Deployment Steps ## 1. Build the app From de78cee88adb4f8028e8b0e67259cfdcc71d5d30 Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 17:11:58 +0800 Subject: [PATCH 09/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index 02cc2ced9..b14c671f8 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -15,7 +15,7 @@ The following are the instructions to deploy the angular-fullstack app to Google # Deployment Setup ## 1. Set Node / NPM versions - GCloud App Engine supports only only for the newest version of Node.js 8 + GCloud App Engine supports only the newest version of Node.js 8 ```javascript "engines": { "node": " =8.0", From a28fb18841305eb9b7b4cbb54e1af6f34364874d Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 17:13:47 +0800 Subject: [PATCH 10/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index b14c671f8..aa650057b 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -5,12 +5,15 @@ The following are the instructions to deploy the angular-fullstack app to Google ## 1. Google Cloud SDK Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) ## 2. Create GCP Project - `gcloud projects create PROJECT_ID` + ```bash + gcloud projects create PROJECT_ID + ``` ## 3. Enable Billing - `gcloud alpha billing projects link my-project \ - --billing-account 0X0X0X-0X0X0X-0X0X0X` - - ## Create a MongoDB database + ```bash + gcloud alpha billing projects link my-project \ + --billing-account 0X0X0X-0X0X0X-0X0X0X + ``` + ## 4. Create a MongoDB database Create a MongoDB instance and obtain the uri and credentials # Deployment Setup From 3319ed63a15dafc617848cc8c4b793f553a9dda8 Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 17:15:23 +0800 Subject: [PATCH 11/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index aa650057b..ac31cfe74 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -27,9 +27,10 @@ The following are the instructions to deploy the angular-fullstack app to Google ``` ## 2. Create Application configuration file (app.yaml) - A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, scaling, and other general settings including environment variables. + A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, + scaling, and other general settings including environment variables. - 2.1 create a 'app.yaml' file with the following contents + ### 2.1 create a 'app.yaml' file with the following contents ```javascript @@ -42,7 +43,7 @@ The following are the instructions to deploy the angular-fullstack app to Google ``` - 2.2 Add app.yaml to .gitignore + ### 2.2 Add app.yaml to .gitignore # Deployment Steps ## 1. Build the app From 5c398624e6ca684c39bd46ecf5746321a60ef57b Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sat, 7 Jul 2018 17:15:54 +0800 Subject: [PATCH 12/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index ac31cfe74..1d08f7864 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -30,7 +30,7 @@ The following are the instructions to deploy the angular-fullstack app to Google A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, scaling, and other general settings including environment variables. - ### 2.1 create a 'app.yaml' file with the following contents + 2.1 create a 'app.yaml' file with the following contents ```javascript @@ -43,7 +43,7 @@ The following are the instructions to deploy the angular-fullstack app to Google ``` - ### 2.2 Add app.yaml to .gitignore + 2.2 Add app.yaml to .gitignore # Deployment Steps ## 1. Build the app From 47656fce389a6a5d4b501d3a49e7d1fd4325e358 Mon Sep 17 00:00:00 2001 From: Rohit Acharya Date: Sun, 8 Jul 2018 18:06:38 +0800 Subject: [PATCH 13/13] Update gcloud-deployment.md --- docs/content/deployment/gcloud-deployment.md | 23 ++++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/content/deployment/gcloud-deployment.md b/docs/content/deployment/gcloud-deployment.md index 1d08f7864..471f45e7b 100644 --- a/docs/content/deployment/gcloud-deployment.md +++ b/docs/content/deployment/gcloud-deployment.md @@ -3,25 +3,34 @@ The following are the instructions to deploy the angular-fullstack app to Google # Prequsites ## 1. Google Cloud SDK - Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) + Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) ## 2. Create GCP Project ```bash - gcloud projects create PROJECT_ID - ``` + gcloud projects create [PROJECT_ID] + ``` + ```[PROJECT_ID]``` ID for the project you want to create. + ## 3. Enable Billing + You need to enable billing for your project before you begin using App Engine ```bash gcloud alpha billing projects link my-project \ --billing-account 0X0X0X-0X0X0X-0X0X0X ``` + [gcloud alpha billing projects link](https://cloud.google.com/sdk/gcloud/reference/alpha/billing/projects/link) + ## 4. Create a MongoDB database - Create a MongoDB instance and obtain the uri and credentials + Create a MongoDB instance and obtain the uri and credentials. There are multiple options for creating a new MongoDB database. + - Create a Google Compute Engine virtual machine with [MongoDB pre-installed](https://cloud.google.com/launcher/?q=mongodb). + - Create a MongoDB instance with [MongoDB Atlas on GCP](https://www.mongodb.com/cloud/atlas/mongodb-google-cloud). + - Use [mLab](https://mlab.com/google) to create a free MongoDB deployment on Google Cloud Platform. + # Deployment Setup ## 1. Set Node / NPM versions GCloud App Engine supports only the newest version of Node.js 8 ```javascript "engines": { - "node": " =8.0", + "node": ">=8.0", "npm": "^5.1.1" }, ``` @@ -32,7 +41,7 @@ The following are the instructions to deploy the angular-fullstack app to Google 2.1 create a 'app.yaml' file with the following contents - ```javascript + ```yaml env: standard @@ -52,7 +61,7 @@ The following are the instructions to deploy the angular-fullstack app to Google ``` ## 2. Copy app.yaml to dist ```bash - copy app.yaml dist + cp app.yaml dist ``` ## 3. Change to build directory ```bash