We will walk through the steps, but at a high level, they are:
- Install git
- Install Vagrant
- Clone the source
- Start a Vagrant VM
- SSH to your Vagrant VM
- Migrate databases
- Contribute!
git is an extremely powerful source-code management tool. We use it in conjunction with Github to manage changes to the code that runs this project. You should install it according to the instructions on git-scm.com.
Vagrant is a tool for creating and managing Virtual Machines. In this guide, we'll use it to create a virtual Ubuntu machine from which you'll run this project. You should install Vagrant according to the instructions on vagrantup.com.
It is best to create your own fork of this project to contribute to it. You can do that by clicking this here link. Now that you have your own fork, you can use git to get a copy of the source for this site (remember to replace <your-github-username>
with your actual Github username):
git clone [email protected]:<your-github-username>/green_mercury.git
cd green_mercury
git remote add upstream https://github.com/code-scouts/green_mercury.git
Note that the first command will fail if you have not yet set up ssh keys for Github. They provide an excellent guide to this, which you should follow if you need help. The full range of things you can do to the code using Git and Github is outside the scope of this document, but it is extensive. If you're new to Git and Github, try Github's interactive tutorial for a crash course.
This command will instruct Vagrant to create a new virtual machine for you that has all the requirements for Green Mercury already installed. This single command will do a lot of work on your behalf, so please be patient with the amount of time it can take:
vagrant up
This command will use ssh to start an interactive shell on your VM. After running this command you'll be "shelled in" to your virtual machine. Commands you type there will run in the VM, not on your real computer.
vagrant ssh
Now that you have the dependencies installed, it's time to set up the dev and test databases.
cd green_mercury
rake db:migrate
rake db:migrate RAILS_ENV=test
Once you have some changes that you think will improve the site, commit them with git:
git commit -a -m "A brief summary of what you did"
git push origin
Then use the new-pull-request page to create a pull request so we can see your great work!