-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
91 lines (78 loc) · 19.9 KB
/
Copy pathindex.html
File metadata and controls
91 lines (78 loc) · 19.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#2B3A42">
<link rel="shortcut icon" href="/assets/favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:400,600|Source+Sans+Pro:200,400,400i,500" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
<link href="/093c5e94a96399fbbcb5.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
</head>
<body>
<div id="site" class="site"><div class="interactive" id="components/navigation/navigation.jsx" data-props="{"sections":[{"title":"Get-Started","url":"get-started","pages":[{"title":"Installation","url":"get-started/installation"},{"title":"Running","url":"get-started/running"},{"title":"Project Overview","url":"get-started/overview"}]},{"title":"Guides","url":"guides","pages":[{"title":"asdf","url":"guides/asdf"}]},{"title":"Developing","url":"developing","pages":[{"title":"developing/01_Adding_a_Route","url":"developing/01_Adding_a_Route"}]},{"title":"Deployment","url":"deployment","pages":[{"title":"deployment/gcloud-deployment","url":"deployment/gcloud-deployment"}]},{"title":"Examples","url":"examples","pages":[{"title":"Heroku Deploy","url":"examples/Heroku_Deployment"},{"title":"IIS","url":"examples/IIS"}]},{"title":"Generators","url":"generators","pages":[{"title":"App","url":"generators/app"},{"title":"Route","url":"generators/route"},{"title":"Service","url":"generators/service"},{"title":"Component","url":"generators/component"},{"title":"Controller","url":"generators/controller"},{"title":"Decorator","url":"generators/decorator"},{"title":"Directive","url":"generators/directive"},{"title":"Endpoint","url":"generators/endpoint"},{"title":"Filter","url":"generators/filter"},{"title":"Heroku","url":"generators/heroku"},{"title":"Openshift","url":"generators/openshift"}]},{"title":"Other","url":"/","pages":[]}],"pageUrl":"deployment/gcloud-deployment"}"><header class="navigation"><div class="container navigation__inner"></div><div class="navigation__bottom"><div class="container navigation__inner"></div></div></header></div><div class="interactive" id="components/sidebar-mobile/sidebar-mobile.jsx" data-props="{"sections":[{"title":"Get-Started","url":"get-started","pages":[{"title":"Installation","url":"get-started/installation"},{"title":"Running","url":"get-started/running"},{"title":"Project Overview","url":"get-started/overview"}]},{"title":"Guides","url":"guides","pages":[{"title":"asdf","url":"guides/asdf"}]},{"title":"Developing","url":"developing","pages":[{"title":"developing/01_Adding_a_Route","url":"developing/01_Adding_a_Route"}]},{"title":"Deployment","url":"deployment","pages":[{"title":"deployment/gcloud-deployment","url":"deployment/gcloud-deployment"}]},{"title":"Examples","url":"examples","pages":[{"title":"Heroku Deploy","url":"examples/Heroku_Deployment"},{"title":"IIS","url":"examples/IIS"}]},{"title":"Generators","url":"generators","pages":[{"title":"App","url":"generators/app"},{"title":"Route","url":"generators/route"},{"title":"Service","url":"generators/service"},{"title":"Component","url":"generators/component"},{"title":"Controller","url":"generators/controller"},{"title":"Decorator","url":"generators/decorator"},{"title":"Directive","url":"generators/directive"},{"title":"Endpoint","url":"generators/endpoint"},{"title":"Filter","url":"generators/filter"},{"title":"Heroku","url":"generators/heroku"},{"title":"Openshift","url":"generators/openshift"}]},{"title":"Other","url":"/","pages":[]}]}"><nav class="sidebar-mobile"><div class="sidebar-mobile__toggle"></div><div class="sidebar-mobile__content"><i class="sidebar-mobile__close icon-cross"></i><div class="sidebar-mobile__section "><a href="/get-started" class="sidebar-mobile__section-header"></a><a href="/get-started/installation" class="sidebar-mobile__page "></a><a href="/get-started/running" class="sidebar-mobile__page "></a><a href="/get-started/overview" class="sidebar-mobile__page "></a></div><div class="sidebar-mobile__section "><a href="/guides" class="sidebar-mobile__section-header"></a><a href="/guides/asdf" class="sidebar-mobile__page "></a></div><div class="sidebar-mobile__section "><a href="/developing" class="sidebar-mobile__section-header"></a><a href="/developing/01_Adding_a_Route" class="sidebar-mobile__page "></a></div><div class="sidebar-mobile__section "><a href="/deployment" class="sidebar-mobile__section-header"></a><a href="/deployment/gcloud-deployment" class="sidebar-mobile__page "></a></div><div class="sidebar-mobile__section "><a href="/examples" class="sidebar-mobile__section-header"></a><a href="/examples/Heroku_Deployment" class="sidebar-mobile__page "></a><a href="/examples/IIS" class="sidebar-mobile__page "></a></div><div class="sidebar-mobile__section "><a href="/generators" class="sidebar-mobile__section-header"></a><a href="/generators/app" class="sidebar-mobile__page "></a><a href="/generators/route" class="sidebar-mobile__page "></a><a href="/generators/service" class="sidebar-mobile__page "></a><a href="/generators/component" class="sidebar-mobile__page "></a><a href="/generators/controller" class="sidebar-mobile__page "></a><a href="/generators/decorator" class="sidebar-mobile__page "></a><a href="/generators/directive" class="sidebar-mobile__page "></a><a href="/generators/endpoint" class="sidebar-mobile__page "></a><a href="/generators/filter" class="sidebar-mobile__page "></a><a href="/generators/heroku" class="sidebar-mobile__page "></a><a href="/generators/openshift" class="sidebar-mobile__page "></a></div><div class="sidebar-mobile__section "><a href="//" target="_blank" class="sidebar-mobile__section-header"></a></div></div></nav></div><div class="container page"><aside class="sidecar"><a href="//github.com/angular-fullstack/generator-angular-fullstack" target="_blank" class="sidecar__link sidecar__link--github"><span class="sidecar__label">Fork the Repo</span><i class="sidecar__icon icon-github"></i></a><a class="sidecar__link sidecar__link--gitter js-gitter-toggle-chat-button"><span class="sidecar__label">Find Help</span><i class="sidecar__icon icon-gitter"></i></a><a href="//stackoverflow.com/questions/tagged/generator-angular-fullstack" target="_blank" class="sidecar__link sidecar__link--so"><span class="sidecar__label">Stack Overflow</span><i class="sidecar__icon icon-stack-overflow"></i></a></aside><div class="interactive" id="components/sidebar/sidebar.jsx" data-props="{"sectionName":"deployment","pages":[{"url":"deployment/gcloud-deployment","anchors":[{"title":"Prequsites","id":"prequsites"},{"title":"1. Google Cloud SDK","id":"1-google-cloud-sdk"},{"title":"2. Create GCP Project","id":"2-create-gcp-project"},{"title":"3. Enable Billing","id":"3-enable-billing"},{"title":"4. Create a MongoDB database","id":"4-create-a-mongodb-database"},{"title":"Deployment Setup","id":"deployment-setup"},{"title":"1. Set Node / NPM versions","id":"1-set-node-npm-versions"},{"title":"2. Create Application configuration file (app.yaml)","id":"2-create-application-configuration-file-app-yaml-"},{"title":"Deployment Steps","id":"deployment-steps"},{"title":"1. Build the app","id":"1-build-the-app"},{"title":"2. Copy app.yaml to dist","id":"2-copy-app-yaml-to-dist"},{"title":"3. Change to build directory","id":"3-change-to-build-directory"},{"title":"4. Deploy","id":"4-deploy"}]}],"currentPage":"deployment/gcloud-deployment"}"><nav class="sidebar"><div class="sidebar__inner"><h3 class="sidebar-item__version">Version 4.1.x</h3><div class="sidebar-item sidebar-item--empty "><a href="/deployment" class="sidebar-item__title"></a><i class="sidebar-item__toggle icon-chevron-down"></i><ul class="sidebar-item__anchors"></ul></div><div class="sidebar-item sidebar-item--open"><a href="/deployment/gcloud-deployment" class="sidebar-item__title"></a><i class="sidebar-item__toggle icon-chevron-down"></i><ul class="sidebar-item__anchors"><li class="sidebar-item__anchor"><a href="#prequsites">Prequsites</a></li><li class="sidebar-item__anchor"><a href="#1-google-cloud-sdk">1. Google Cloud SDK</a></li><li class="sidebar-item__anchor"><a href="#2-create-gcp-project">2. Create GCP Project</a></li><li class="sidebar-item__anchor"><a href="#3-enable-billing">3. Enable Billing</a></li><li class="sidebar-item__anchor"><a href="#4-create-a-mongodb-database">4. Create a MongoDB database</a></li><li class="sidebar-item__anchor"><a href="#deployment-setup">Deployment Setup</a></li><li class="sidebar-item__anchor"><a href="#1-set-node-npm-versions">1. Set Node / NPM versions</a></li><li class="sidebar-item__anchor"><a href="#2-create-application-configuration-file-app-yaml-">2. Create Application configuration file (app.yaml)</a></li><li class="sidebar-item__anchor"><a href="#deployment-steps">Deployment Steps</a></li><li class="sidebar-item__anchor"><a href="#1-build-the-app">1. Build the app</a></li><li class="sidebar-item__anchor"><a href="#2-copy-app-yaml-to-dist">2. Copy app.yaml to dist</a></li><li class="sidebar-item__anchor"><a href="#3-change-to-build-directory">3. Change to build directory</a></li><li class="sidebar-item__anchor"><a href="#4-deploy">4. Deploy</a></li></ul></div></div></nav></div><section class="page__content"><h1></h1><a class="page__edit" href="https://github.com/angular-fullstack/generator-angular-fullstack/edit/master/docs/content/deployment/gcloud-deployment.md">Edit this Page   <i class="icon-edit"></i></a><div><p>The following are the instructions to deploy the angular-fullstack app to Google Cloud App Engine Standard Environment</p>
<h1 class="header"><a class="anchor" href="#prequsites" id="prequsites"></a><span class="text">Prequsites</span><a class="icon-link" href="#prequsites"></a></h1>
<h2 class="header"><a class="anchor" href="#1-google-cloud-sdk" id="1-google-cloud-sdk"></a><span class="text">1. Google Cloud SDK</span><a class="icon-link" href="#1-google-cloud-sdk"></a></h2>
<p> Download and install <a href="https://cloud.google.com/sdk/">Google Cloud SDK</a></p>
<h2 class="header"><a class="anchor" href="#2-create-gcp-project" id="2-create-gcp-project"></a><span class="text">2. Create GCP Project</span><a class="icon-link" href="#2-create-gcp-project"></a></h2>
<pre><code class="lang-bash"> gcloud projects create <span class="token punctuation">[</span>PROJECT_ID<span class="token punctuation">]</span>
</code></pre>
<p> <code>[PROJECT_ID]</code> ID for the project you want to create.</p>
<h2 class="header"><a class="anchor" href="#3-enable-billing" id="3-enable-billing"></a><span class="text">3. Enable Billing</span><a class="icon-link" href="#3-enable-billing"></a></h2>
<p> You need to enable billing for your project before you begin using App Engine</p>
<pre><code class="lang-bash"> gcloud alpha billing projects <span class="token function">link</span> my-project \
--billing-account 0X0X0X-0X0X0X-0X0X0X
</code></pre>
<p> <a href="https://cloud.google.com/sdk/gcloud/reference/alpha/billing/projects/link">gcloud alpha billing projects link</a></p>
<h2 class="header"><a class="anchor" href="#4-create-a-mongodb-database" id="4-create-a-mongodb-database"></a><span class="text">4. Create a MongoDB database</span><a class="icon-link" href="#4-create-a-mongodb-database"></a></h2>
<p> Create a MongoDB instance and obtain the uri and credentials. There are multiple options for creating a new MongoDB database.</p>
<ul>
<li>Create a Google Compute Engine virtual machine with <a href="https://cloud.google.com/launcher/?q=mongodb">MongoDB pre-installed</a>.</li>
<li>Create a MongoDB instance with <a href="https://www.mongodb.com/cloud/atlas/mongodb-google-cloud">MongoDB Atlas on GCP</a>.</li>
<li>Use <a href="https://mlab.com/google">mLab</a> to create a free MongoDB deployment on Google Cloud Platform.</li>
</ul>
<h1 class="header"><a class="anchor" href="#deployment-setup" id="deployment-setup"></a><span class="text">Deployment Setup</span><a class="icon-link" href="#deployment-setup"></a></h1>
<h2 class="header"><a class="anchor" href="#1-set-node-npm-versions" id="1-set-node-npm-versions"></a><span class="text">1. Set Node / NPM versions</span><a class="icon-link" href="#1-set-node-npm-versions"></a></h2>
<pre><code>GCloud App Engine supports only the newest version of Node.js 8
</code></pre><pre><code class="lang-javascript"> <span class="token string">"engines"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"node"</span><span class="token punctuation">:</span> <span class="token string">">=8.0"</span><span class="token punctuation">,</span>
<span class="token string">"npm"</span><span class="token punctuation">:</span> <span class="token string">"^5.1.1"</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
</code></pre>
<h2 class="header"><a class="anchor" href="#2-create-application-configuration-file-app-yaml-" id="2-create-application-configuration-file-app-yaml-"></a><span class="text">2. Create Application configuration file (app.yaml)</span><a class="icon-link" href="#2-create-application-configuration-file-app-yaml-"></a></h2>
<pre><code>A Node.js app <span class="token keyword">in</span> App Engine is configured through a <span class="token function">file</span> named app.yaml, that contains runtime, handlers,
scaling, and other general settings including environment variables.
2.1 create a <span class="token string">'app.yaml'</span> <span class="token function">file</span> with the following contents
</code></pre><pre><code class="lang-yaml">
<span class="token key atrule">env</span><span class="token punctuation">:</span> standard
<span class="token key atrule">runtime</span><span class="token punctuation">:</span> nodejs8
<span class="token key atrule">env_variables</span><span class="token punctuation">:</span>
<span class="token key atrule">MONGODB_URI</span><span class="token punctuation">:</span> <span class="token string">"mongodb://<dbuser :<dbpassword @<environment_URI/deployment_name"</span>
</code></pre>
<pre><code>2.2 Add app.yaml to .gitignore
</code></pre><h1 class="header"><a class="anchor" href="#deployment-steps" id="deployment-steps"></a><span class="text">Deployment Steps</span><a class="icon-link" href="#deployment-steps"></a></h1>
<h2 class="header"><a class="anchor" href="#1-build-the-app" id="1-build-the-app"></a><span class="text">1. Build the app</span><a class="icon-link" href="#1-build-the-app"></a></h2>
<pre><code class="lang-bash"> gulp build
</code></pre>
<h2 class="header"><a class="anchor" href="#2-copy-app-yaml-to-dist" id="2-copy-app-yaml-to-dist"></a><span class="text">2. Copy app.yaml to dist</span><a class="icon-link" href="#2-copy-app-yaml-to-dist"></a></h2>
<pre><code class="lang-bash"> <span class="token function">cp</span> app.yaml dist
</code></pre>
<h2 class="header"><a class="anchor" href="#3-change-to-build-directory" id="3-change-to-build-directory"></a><span class="text">3. Change to build directory</span><a class="icon-link" href="#3-change-to-build-directory"></a></h2>
<pre><code class="lang-bash"> <span class="token function">cd</span> dist
</code></pre>
<h2 class="header"><a class="anchor" href="#4-deploy" id="4-deploy"></a><span class="text">4. Deploy</span><a class="icon-link" href="#4-deploy"></a></h2>
<pre><code class="lang-bash"> gcloud app deploy
</code></pre>
</div><hr style="display:none;"><h3 style="display:none;">Contributors</h3><noscript></noscript></section></div><div class="footer"><div class="container footer__inner"><section class="footer__left"><a href="/get-started" class="footer__link">Get Started</a><a href="https://github.com/angular-fullstack" target="_blank" class="footer__link">Organization</a><a href="https://github.com/angular-fullstack/generator-angular-fullstack/blob/master/contributing.md" target="_blank" class="footer__link">Contribute</a></section><section class="footer__middle"><a href="/" class="footer__icon"><img src="/44c8aeaa24cb28d0a5c6a45de449fd7d.svg"></a></section><section class="footer__right"><a href="https://gitter.im/angular-fullstack/generator-angular-fullstack" target="_blank" class="footer__link">Support</a><a href="https://github.com/angular-fullstack/generator-angular-fullstack/releases" target="_blank" class="footer__link">Changelog</a></section></div></div><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-46921629-2', 'auto');ga('send', 'pageview');</script></div>
<script src="/89895afd3ccffb6408887b33d5400066.js"></script>
<script>
((window.gitter = {}).chat = {}).options = {
room: 'angular-fullstack/generator-angular-fullstack',
activationElement: false
};
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
</body>
</html>