Inspired by Migrating Meteor Apps from Modulus to Galaxy with Continuous Deployment from Codeship written by @nate-strauser
Use Shippable to deploy to Meteor Galaxy.
Shippable encourages users to encrypt sensitive data in encrypted environment variables rather than in plain text in their shippable.yml
... and rightly so!
The only issue is that can be a real pain to get your Meteor authentication token and Meteor settings, both of which are JSON representations, working in Shippable.
The supplied shippable.yml
in this repo helps you with that and will hopefully save you hours of debugging.
Please see @nate-strauser's article Migrating Meteor Apps from Modulus to Galaxy with Continuous Deployment from Codeship for a more details.
meteor_settings.json
{
"galaxy.meteor.com": {
"env": {
"ROOT_URL": "http://www.awesomesite.com",
"MONGO_URL": "mongodb://USERNAME:[email protected]:12345,candidate.21.mongolayer.com:12345/somedatabase",
"MONGO_OPLOG_URL": "mongodb://USERNAME:[email protected]:12345,candidate.21.mongolayer.com:12345/local?authSource=somedatabase",
"MAIL_URL": "smtp://postmaster@awesomesite:[email protected]:587"
}
}
}
For more info see Meteor.settings docs
On a box where you have meteor installed run:
$ METEOR_SESSION_FILE=meteor_token.json meteor login
to get the meteor_token.json
file.
In the directory where you have your meteor_settings.json
and meteor_token.json
files run:
$ node create-env-string.js <hostname>
or if you have your files somewhere else run:
$ node create-env-string.js <hostname> <token-path> <settings-path>
NOTE: hostname
is the fully qualified domain name where you're planning to host your application (for example, 'www.awesomesite.com').
-
Get your METEOR_SETTINGS and METEOR_TOKEN into the correct format to enter in the encrypted environment variables section on your project's shippable settings page. Use the output from the Shippable encrypted environment variable string section above.
-
Insert the formatted string in the encrypted environment variables section on your project's shippable settings page and click the encrypt button.
-
Copy the output to the
env
section in theshippable.yml
. -
Copy the updated
shippable.yml
to your project and enjoy automated Meteor Galaxy deployments. :-)
- Review best approach for multi branch deployment.
- Check if there is a shippable API to get the encrypted string as part of the string creation script.