Skip to content
Martin H. Bramwell edited this page Feb 1, 2017 · 9 revisions

Deprecated! Please refer to the steps specified directly in the README.md

These are the steps I take to set up Meteor Mantra Kickstarter in a virtual machine running Xubuntu Xenial.

If you are in a disposable virtual machine with a recent fresh Ubuntu installation, you can follow more or less blindly. Please, do NOT do this in a machine that has stuff you care about!

  1. Pull in GitHub SSH credentials from sister VM.

    pushd ~/.ssh
    scp -r 192.168.122.xxx:/home/you/.ssh .
    popd
    
  2. Ensure dependencies are clean and up-to-date :

    sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo apt-get -y clean && sudo apt-get -y autoremove;
    
  3. Install and Configure git :

    git config --global user.name "You Yourself"
    git config --global user.email "[email protected]"
    git config --global credential.helper cache
    git config --global credential.helper 'cache --timeout=36000'
    git config --global push.default simple
    
  4. Make a parent directory and step into it :

    mkdir -p ~/projects
    cd ~/projects
    
  5. Clone our repository and step into it :

    git clone [email protected]:warehouseman/meteor-mantra-kickstarter.git
    cd meteor-mantra-kickstarter    
    
  6. Switch over to our branch :

    git checkout trunk
    git branch # verify being on trunk
    
  7. Run the script to set up for development and testing (installs Java, NodeJS, Chimp, Meteor and the project's NodeJS package dependencies) :

    .e2e_tests/chimp-install.sh
    
  8. Prepare our settings.json :

    cp settings.json.example settings.json
    nano settings.json
    

    You'll need to go get your Mailgun API key. and your Loggly domain token, then correct these settings :

    >   "HOST_URI": "localhost:3000",
    >   "MAILGUN_DOMAIN": "yourhost.yourpublic.work",
    >   "MAILGUN_KEY": "(As if I'm gonna to leave THAT lying around.)  A valid key has 36 characters and begins with 'key-'.",
    >   "LOGGLY_SUBDOMAIN": "yourwork",
    >   "LOGGLY_TOKEN": " ( not this either ) ",
    
    • Note : If you don't care whether password reset works, you don't need Mailgun. In that case, you can use this as your API key ... key-dead0dead0dead0dead0dead0dead000.
  9. Run Meteor for the first time to get everything in place :

    meteor --settings=settings.json
    

    We should find our app running at http://localhost:3000

  10. (This does not seem to be necessary anymore) Terminate Meteor with <ctrl-c> and then run the following script to get rid of all those spurious missing dependencies from the Mailgun transport package :

    npm run workarounds
    
  11. Shorten the time it takes to reload and rerun after code changes :

    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
    
  12. Now we can run Meteor and explore at http://localhost:3000 :

    meteor --settings=settings.json
    

    (The first time through, you may see it terminate with the message killed. Just run it again.)

  13. Open a new terminal window to run linting and unit-tests :

    cd ~/projects/meteor-mantra-kickstarter/
    npm test
    

    A goodly portion of the client side is fully tested using the familiar tools Mocha, Chai and Sinon.

  14. Open another terminal window and run acceptance tests :

    source ~/.profile # if you have not yet logged out since running '.e2e_tests/chimp-install.sh'
    cd ~/projects/meteor-mantra-kickstarter/
    npm run acceptance
    
  15. See the scripts section of package.json for details of other testing and setup commands.

Other Notes

For my own use, I keep open at least 4 terminal windows, with these commands, ready to run :

  1. For running Meteor

    cd projects/meteor-mantra-kickstarter/
    meteor --settings=settings.json
    
  2. For running acceptance tests

    cd projects/meteor-mantra-kickstarter/
    npm run acceptance
    
  3. For checking changes in the database

    cd projects/meteor-mantra-kickstarter/
    meteor mongo
    # then
     db.users.findOne({ "emails.address" : "[email protected]" });
     db.getCollection("_colors").find({});
    
  4. For searching for keywords in the code

    cd projects/meteor-mantra-kickstarter/
    grep -R --exclude=\*.{css,txt,min.js} --exclude-dir={.git,.meteor,node_modules} "key" -A 1
    

I tend to use the above commands daily. To get quickly ready to work, I open this file, open the four terminal windows and cut and paste into them.