E54: Test deploy to Galaxy

For this experience, you will learn how to deploy a Meteor app to Galaxy in three steps.

Step 1: Deploy digits to Galaxy

You will deploy your digits app to Galaxy. Before starting, make sure your digits app runs correctly on your laptop.

Now follow the instructions in the Galaxy Deploy Guide to run your app in the cloud. Here are some important variations on the guide:

A. Sign up for Galaxy.

Note that you do not have to sign up for Galaxy as an individual and provide your credit card for this class. Instead, you can just login to https://galaxy.meteor.com/ics314f16 with your Meteor account. That organization has been provisioned by the Meteor Development Group (thank you MDG!) for this class with several free containers.

In order to login to that organization, you must have provided your meteor.com username in the #meteoraccountnames channel so that I can add you to the ics314f16 organization.

B. Configure your MongoDB Database.

Follow the instructions for creating a free “sandbox” account at mLab.

C. Create a settings file for Galaxy

Recall that your app uses the default directory structure (app/, doc/, and config/) as in meteor-application-template. So, put the settings.json file in the config/ directory. Because the settings.json file contains sensitive information (i.e. the MongoDB username and password in clear text), you should immediately add that file name to your .gitignore to make sure it does not get committed to GitHub.

D. Select a hostname.

Before moving on to the “Deploy your application to Galaxy” step, you have to decide on your hostname. For this class, it will be “foo.meteorapp.com”, where “foo” is replaced by your application name. Note that you’ll have to come up with an application name that has not already been deployed at meteorapp.com.

For the purposes of this test deployment exercise, I suggest a hostname consisting of “testdeploy” plus your initials so that the resulting hostname is unique. In my case, that would be “testdeploypmj”. (You can actually pick anything not already deployed since you’ll delete your application from Galaxy in a few minutes.)

E. Deploy your application to Galaxy.

An important change to this section is to add --owner ics314f16 to the deploy command so that the app is deployed to our class organization, not to your personal account. That way you will not be charged for your deployment.

Here’s what the full command looks like for me:

DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy testdeploypmj.meteorapp.com --owner ics314f16 --settings ../config/settings.json

Everyone will need to change the above command to use their own hostname. Windows users have a slightly different command; see the Deploy Guide for details.

If this command completes successfully, you’ll see a message like this in your console when it’s done:

Talking to Galaxy servers at https://galaxy.meteor.com                             
Deploying your app...                         
App starting at testdeploypmj.meteorapp.com in ics314f16's account in us-east-1.
Visit https://galaxy.meteor.com/app/testdeploypmj.meteorapp.com to check the status of your app.

Step 2: Document your deployment

Once you have successfully deployed your app, go to the URL displayed in your console (in my case, it was “https://galaxy.meteor.com/app/testdeploypmj.meteorapp.com”). You should see a dashboard with a spinning green circle near the top. The spinning green circle means Galaxy is in the process of deploying your application.

If you want to watch the progress of the deploy, click on the “Logs” menu item and select “autoscrolling” at the bottom of the page.

The spinning green circle should be replaced by a solid green circle within a couple of minutes. If not, check the logs to see what went wrong. For example, here is my dashboard after successful deployment:

Now take your own screenshot of this page to verify that you have successfully deployed your app, and post it to the #deployment Slack channel.

Finally, bring up your sample app in a web browser to verify that it works as expected. (Click on the arrow on the right side of the app’s hostname). Here is my Digits app running on meteorapp.com:

Step 3: Delete your app

Our organization only has a few containers, so you can’t leave your test deployment hanging around. Instead, once you’ve created your screenshot, you should delete your test deployment app from Galaxy.

To do this, go to your deployment dashboard, click on the Settings menu item, then scroll down to the “Danger Zone”:

Go ahead and click the “DELETE” button to delete your test app.

Submission

By the date and time indicated on the Calendar page, please finish all three steps. Make sure to post your screenshot to the #deployment channel.