Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

The Contributor's How to Guide

Colin Rice edited this page Jul 25, 2013 · 13 revisions

The Contributor's How to Guide

How to make changes

If you are on Windows open up the git bash, everyone else grab a terminal. Remember, commit early and often and always check your work before committing. Check everything again before pushing to github!

  1. Check for changes upstream:

    cd /path/to/Observatory
    git pull origin
    
  2. Make sure you are on the right branch, you probably want the dev branch:

    git branch
    > * master
    > def
    git checkout dev
    
  3. Make whatever changes you want to any files you need to.

  4. Git can tell you what branch you are on and what you have done at any time:

    git status
    
  5. Test out your changes using make test:

    cd Observatory
    make test
    Lots of random output
    #Check it out in your browser @ localhost:8000
    
  1. Checkout the right branch, add your changes, and commit:

    git checkout dev
    git add path/to/file1 path/to/file2 path/to/file3
    git status #Review what you are committing
    git commit -m "Your message here. Be descriptive"
    
  2. Check everything again, if you push something broken, its hard to fix

  3. Push your changes up to github:

    git push
    
  4. Check github for your changes!

    http://github.com/rcos/Observatory/commits/<branchname>

  5. Repeat as necessary

How to handle pull requests

Github has a pretty nice and simple help page for this if you view the pull request and click the Merge Help button.

In general there are 3 steps

  1. Add a new remote location for their repository:

    git remote add bamnet-observatory https://github.com/bamnet/Observatory.git
    
  2. Grab and review their changes on a new branch:

    git checkout -b bamnet dev
    git pull bamnet-observatory dev
    cd observatory
    make test
    
  3. If everything checks out, merge the changes and push:

    git checkout dev
    git pull bamnet-observatory dev
    git pull #check for changes in origin
    git push #push the new commits
    

How to push changes to production

Plan A (No database changes)

  1. Add a new tag pointing at the commit you want to deploy:

    git tag
    v1
    v2
    ...
    v8
    git tag -a v9
    
  2. Do the deploy:

    make deploy
    password:
    
  3. Enter the deploy password:

    password:
    
  4. Wait for it to finish:

    Notice: Finished catalog run in 322.91 seconds
    Connection to rcos.rpi.edu closed.
    

Plan B (Database changes)

  1. Read about how south does database migrations
  2. Create the database migration file
  3. Do the normal deploy steps

Notes for Cygwin Users

Cygwin users could potentially have trouble getting started with github. Follow their directions for setting up your account and keep the following things in mind:

  1. You want to use the cygwin/home/<user>/.ssh folder for your ssh files
  2. If you get ssh [email protected] Error PTY allocation request failed on channel 0 try it with a -T flag which should (probably) make it go away.