Go currently supports developers on Linux, macOS and Windows platforms through
both the Docker and Vagrant virtualization platforms. You may use either one
though we have included instructions for manual setup as well. Here's our walk-through
of steps we will take:
**macOS (Formerly OS X)**
1. Install `git` on your system.
2. Clone the Go codebase.
3. Get Go up and running with the method of your choice.
This tutorial uses the third party Homebrew package manager for macOS, which allows you to install packages from your terminal just as easily as you could on a Linux based system. You could use another package manager (or not use one at all), but Homebrew is highly reccomended.
## 1) Install `git` on your system.
To get homebrew, run the following command in a terminal: `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)`
`git` is the version control system used for SRCT projects.
**Note**: You do NOT need to use `sudo` when running any Homebrew commands, and it likely won't work if you do.
### On Linux Based Systems
Next, to make sure Homebrew is up to date, run `brew update`
Finally we can install python and git with `brew install python git`
### Cloning the Go Codebase
Now, we're going to clone down a copy of the Go codebase from [git.gmu.edu](http://git.gmu.edu/srct/go), the SRCT code respository.
Configure your ssh keys by following the directions at [git.gmu.edu/help/ssh/README](http://git.gmu.edu/help/ssh/README).
Now, on your computer, navigate to the directory in which you want to download the project (perhaps one called development/ or something similar), and run
`$ git clone git@git.gmu.edu:srct/go.git`
### If Using Docker
First, install Docker on your system.
* For macOS go here: https://docs.docker.com/docker-for-mac/
* For windows go here: https://docs.docker.com/docker-for-windows/
* For you specific linux disro go here: https://docs.docker.com/engine/installation/
Additionally if you are not on Mac or Windows you will need to install docker-compose: https://docs.docker.com/compose/install/
Next go to the directory with the docker-compose file in it and run:
`$ docker-compose up`
Open a terminal and run the following command:
If that doesn't work, try:
$ sudo apt-get update
`$ sudo docker-compose up`
This retrieves links to the most up-to-date and secure versions of your packages.
SOMETIMES if this branch is updated you might have to
You should see that the server is running by going to http://localhost:8000 in your browser.
Any changes you make to your local file system will be mirrored in the server.
Next, with:
### If Using Vagrant
Finally, install these packages from the standard repositories:
- VirtualBox
$ sudo apt-get install git
On Ubuntu:
`$ sudo apt-get install virtualbox`
you install `git` onto your system.
### On macOS
You should be installing the latest VirtualBox version which as of time of writing is `5.0.24_Ubuntur108355`. You can verify the version number by running `vboxmanage --version`.
We recommend that you use the third party Homebrew package manager for macOS,
which allows you to install packages from your terminal just as easily as you
could on a Linux based system. You could use another package manager (or not
use one at all), but Homebrew is highly reccomended.
- Vagrant
To get homebrew, run the following command in a terminal:
You should be installing the latest vagrant version which as of time of writing is `Vagrant 1.8.1`. You can verify the version number by running `vagrant -v`.
- Ansible
**Note**: You do NOT need to use `sudo` when running any Homebrew commands, and
it likely won't work if you do.
`$ sudo pip install ansible`
Next, to make sure Homebrew is up to date, run:
You should be installing the latest ansible version which as of time of writing is `ansible 2.1.1.0`. You can verify the version number by running `ansible --version`.
$ brew update
**macOS**
Finally we can install git with `brew install git`
First, get VirtualBox from [VirtualBox.org](https://www.virtualbox.org/wiki/Downloads)
### On Windows
Then install Vagrant and Ansible with Homebrew with `brew install Caskroom/cask/vagrant Ansible`
## 2) Clone the Go codebase.
Now, we're going to clone down a copy of the Go codebase from [git.gmu.edu](http://git.gmu.edu/srct/go),
the SRCT code respository.
## Developing with Vagrant
<legend></legend>
Vagrant allows for the virtualization of your development enviornment and automates the setup process for Go.
Configure your ssh keys by following the directions at [git.gmu.edu/help/ssh/README](http://git.gmu.edu/help/ssh/README).
### Vagrant Setup
Navigate to go/ and run:
Now, on your computer, navigate to the directory in which you want to download the project (perhaps one called development/ or something similar), and run
`$ vagrant up`
`$ git clone git@git.gmu.edu:srct/go.git`
This will setup a vm to run Go on your computer and will setup a database, install packages, etc. The first time you run `vagrant up` it may take a few minutes to setup, specifically when installing Go packages. Don't worry as progressive times it will speed up.
## 3) Get Go up and running with the method of your choice.
And that's it! Navigate to [localhost:8000](http://127.0.0.1:8000) in your web browser to view the website.
### Docker
### Additional Notes & Troubleshooting
[docker configuration on the wiki](https://git.gmu.edu/srct/go/wikis/docker-configuration)
The authentication service used for Go is CAS. In local development however we utilize a test server. You can log in using your CAS username for both the username and password fields.
### Vagrant
The default superuser is _dhaynes3_ though this can be changed in _vagrantfile_ if you wish. You can run `$ vagrant provision` to apply this change. Be sure not to include that change in your commits.
*Note:* For a currently undetermined reason at some points if you try to navigate to [localhost](http://127.0.0.1:8000) and you see an error like: "Conenction has been reset" then:
1.`vagrant ssh`
2.`sudo /etc/init.d/networking restart` and then `exit`