You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deployment/gcloud-deploy.md
+82-2
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ If you are using a DNS provider other than Google, you will need to verify owner
73
73
74
74
**NOTE:** This deployment method requires deployment to a **subdomain**, such as `www.mydomain.com` or `app.mydomain.com`, instead of the root domain, `mydomain.com`.
75
75
76
-
####Create a CNAME record
76
+
### Create a CNAME record
77
77
78
78
Navigate to your DNS provider's control panel to access your domain settings. If you are using Google Domains, select the 'Configure DNS' option for your domain. From here, create a new `CNAME` record that will redirect your subdomain to the the Google Storage servers where your app will be hosted, `c.storage.googleapis.com.`.
79
79
@@ -102,7 +102,11 @@ From the navigation menu, select 'Storage' to access your project's Cloud Storag
102
102
103
103
Keep note of both your project name and bucket name, as we will use them to configure our Ember app for deployment in the next step.
104
104
105
-
## Deploy your Ember app
105
+
Next, navigate to your Google Storage 'Browser' view to see all buckets. You should see your frontend application bucket listed, along with some others that have been auto-generated for your backend deployment. At the far right of each bucket listing, you will see a vertical menu that you can click to access **'Edit Website Configuration'**. Click and fill both your **'Main page'** and **'404 (not found) page'** options with `index.html`, since we are about to deploy a single-page app and want any 404 errors to be handled by our Ember app.
106
+
107
+
Your bucket is now ready for deploying our frontend from the command line.
108
+
109
+
## Configure your Ember deployment
106
110
107
111
In your Ember application's directory, install the following packages for deployment:
This sets your deployment location for your Ember app.
134
+
135
+
### Update your Authmaker instance app domain
136
+
137
+
Make sure your Authmaker instance for this project has the correct url for your production application domain. If you used a placeholder domain when you created your instance, update the value to match your production domain - in the case of this example, the same subdomain we used when naming our Google bucket, `www.mydomain.com`.
138
+
139
+
After you've updated your application domain, save your changes and click to view your updated _live_ Ember config object. You should see your production domain reflected as part of the object's `redirectUri`. Copy the full object to use for your app.
140
+
141
+
Open `config/environment.js` and include your unique live config object inside the **production** block. _(Make sure you place it inside the **production** block. We are **not** changing the development block or local config object.)_
To deploy your frontend application, run the following command from your frontend directory:
162
+
163
+
```bash
164
+
$ ember deploy production --activate
165
+
```
166
+
167
+
Your app will build and deploy to your Google storage bucket!
168
+
169
+
**NOTE:** If you run into any permissions errors from GCloud, you might need to first login via the command line by running:
170
+
171
+
```bash
172
+
$ gcloud auth application-default login
173
+
```
174
+
175
+
You will be prompted to login, after which you shouldn't get any permissions errors when you run the deploy command. For more on GCloud command line authentication, see [here](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login).
176
+
177
+
## Deployment Iterations
178
+
179
+
The Authmaker curriculum was designed to be used as part of an iterative development process, continually developing and deploying as your application expands and improves. In the steps above, you updated your app for deployment **_in addition to_** the existing development config. You can continue to develop your application locally without changing any configuration details in the code.
180
+
181
+
### Running locally
182
+
183
+
To start your backend application locally, run:
184
+
185
+
```bash
186
+
$ npm run start-local
187
+
```
188
+
189
+
To start your Ember frontend locally, run:
190
+
191
+
```bash
192
+
$ ember serve
193
+
```
194
+
195
+
### Future deployments
196
+
197
+
To deploy a new version of your backend app, run:
198
+
199
+
```bash
200
+
$ gcloud app deploy --project=PROJECT_NAME
201
+
```
202
+
203
+
To deploy a new version of your frontend Ember app, run:
0 commit comments