First was the task of getting the environment variables from Appfog to match up to the ones expected by Meteor. Meteor uses MongoDB, so first I added a MongoDB service on appfog. This is done easily by clicking on:
And selecting the MongoDB service:
This gives you MongoDB, but unfortunately the environment variables it exposes to your application aren't in the form that Meteor expects. To solve this, I added the MongoHQ add-on. Similar to before, I went to the add-ons section:
And selected the MongoHQ add-on:
I got a suitable URL environment variable when I added the 'MongoHQ' add-on, but the URL was under the name $MONGHQ_URL instead of $MONGO_URL. This is quite easily solved by going to the environment variables:
And setting up the following variable:
I also also set the ROOT_URL environment variable for my application as I wanted to generate absolute urls from meteor.
Previously, I also needed to set the PORT environment variable to $VMC_APP_PORT but this no longer appears to be necessary. If it is necessary for future deployments, the same process is used as for the MONGO_URL variable.
After the environment was correct, I encountered issues from the
fiberspackage bundled with meteor. This was solved by removing the bundled package and reinstalling the
fiberspackage from NPM with the bundled code. As this is needed each time, I wrote the following short script to automate the process (and also store the code that was released).
With this script in place, I can now deploy to Appfog reliably whenever I need to, without having to remember a set of file modifications.
Thanks go to http://blog.philkershaw.me/2012/06/deploy-meteor-to-appfog.html as the starting point for my deployment.