README.md 3.66 KB
Newer Older
David Haynes's avatar
David Haynes committed
1
# Go
Jean Michel Rouly's avatar
Jean Michel Rouly committed
2

David Haynes's avatar
David Haynes committed
3
[![build status](https://git.gmu.edu/srct/go/badges/master/build.svg)](https://git.gmu.edu/srct/go/commits/master)
4
[![coverage report](https://git.gmu.edu/srct/go/badges/master/coverage.svg)](https://git.gmu.edu/srct/go/commits/master) ![python version](https://img.shields.io/badge/python-2.7-blue.svg) ![Django version](https://img.shields.io/badge/Django-1.10-brightgreen.svg)
Jean Michel Rouly's avatar
Jean Michel Rouly committed
5

David Haynes's avatar
David Haynes committed
6
#### A project of [GMU SRCT](http://srct.gmu.edu).
7

David Haynes's avatar
David Haynes committed
8 9 10
Go is a drop-in URL shortening service. This project aims to provide an easy to use
URL branding service for institutions that wish to widely disseminate information
without unnecessarily outsourcing branding.
David Haynes's avatar
David Haynes committed
11

David Haynes's avatar
David Haynes committed
12 13
Go is currently a `Python 2.7` project written in the `Django` web framework, with
`MySQL` as our backend database.
14

David Haynes's avatar
David Haynes committed
15
# Setup instructions for local development
16

David Haynes's avatar
David Haynes committed
17 18 19 20
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:
21

David Haynes's avatar
David Haynes committed
22 23 24
1. Install `git` on your system.
2. Clone the Go codebase.
3. Get Go up and running with the method of your choice.
Zosman's avatar
Zosman committed
25

David Haynes's avatar
David Haynes committed
26
## 1) Install `git` on your system.
Zosman's avatar
Zosman committed
27

David Haynes's avatar
David Haynes committed
28
`git` is the version control system used for SRCT projects.
Zosman's avatar
Zosman committed
29

David Haynes's avatar
David Haynes committed
30
### On Linux Based Systems
Zosman's avatar
Zosman committed
31

David Haynes's avatar
David Haynes committed
32
Open a terminal and run the following command:
mdsecurity's avatar
mdsecurity committed
33

David Haynes's avatar
David Haynes committed
34
    $ sudo apt-get update
Robert Hitt's avatar
Robert Hitt committed
35

David Haynes's avatar
David Haynes committed
36
This retrieves links to the most up-to-date and secure versions of your packages.
Robert Hitt's avatar
Robert Hitt committed
37

David Haynes's avatar
David Haynes committed
38
Next, with:
39

David Haynes's avatar
David Haynes committed
40
    $ sudo apt-get install git
David Haynes's avatar
David Haynes committed
41

David Haynes's avatar
David Haynes committed
42
you install `git` onto your system.
43

David Haynes's avatar
David Haynes committed
44
### On macOS
Zosman's avatar
Zosman committed
45

David Haynes's avatar
David Haynes committed
46 47 48 49
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.
50

David Haynes's avatar
David Haynes committed
51
To get homebrew, run the following command in a terminal:
David Haynes's avatar
David Haynes committed
52

David Haynes's avatar
David Haynes committed
53
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
54

David Haynes's avatar
David Haynes committed
55 56
**Note**: You do NOT need to use `sudo` when running any Homebrew commands, and
it likely won't work if you do.
David Haynes's avatar
David Haynes committed
57

David Haynes's avatar
David Haynes committed
58
Next, to make sure Homebrew is up to date, run:
59

David Haynes's avatar
David Haynes committed
60
    $ brew update
Zosman's avatar
Zosman committed
61

David Haynes's avatar
David Haynes committed
62
Finally we can install git with `brew install git`
Zosman's avatar
Zosman committed
63

David Haynes's avatar
David Haynes committed
64
### On Windows
David Haynes's avatar
David Haynes committed
65 66 67
---

Instruction on how to setup git on Windows goes here.
Zosman's avatar
Zosman committed
68

David Haynes's avatar
David Haynes committed
69
## 2) Clone the Go codebase.
David Haynes's avatar
David Haynes committed
70

David Haynes's avatar
David Haynes committed
71 72
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.
73

David Haynes's avatar
David Haynes committed
74
Configure your ssh keys by following the directions at [git.gmu.edu/help/ssh/README](http://git.gmu.edu/help/ssh/README).
David Haynes's avatar
David Haynes committed
75

David Haynes's avatar
David Haynes committed
76
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
David Haynes's avatar
David Haynes committed
77

David Haynes's avatar
David Haynes committed
78
`$ git clone git@git.gmu.edu:srct/go.git`
David Haynes's avatar
David Haynes committed
79

David Haynes's avatar
David Haynes committed
80
## 3) Get Go up and running with the method of your choice.
81

David Haynes's avatar
David Haynes committed
82
### Docker
David Haynes's avatar
David Haynes committed
83

David Haynes's avatar
David Haynes committed
84
[docker configuration on the wiki](https://git.gmu.edu/srct/go/wikis/docker-configuration)
David Haynes's avatar
David Haynes committed
85

David Haynes's avatar
David Haynes committed
86
### Vagrant
David Haynes's avatar
David Haynes committed
87

David Haynes's avatar
David Haynes committed
88
[config](https://git.gmu.edu/srct/go/wikis/vagrant-configuration)
David Haynes's avatar
David Haynes committed
89

David Haynes's avatar
David Haynes committed
90
[usage](https://git.gmu.edu/srct/go/wikis/vagrant-usage)
David Haynes's avatar
David Haynes committed
91

David Haynes's avatar
David Haynes committed
92
### Manual Setup
David Haynes's avatar
David Haynes committed
93

David Haynes's avatar
David Haynes committed
94
# On Contributing
David Haynes's avatar
David Haynes committed
95 96


David Haynes's avatar
David Haynes committed
97 98
I encourage you to join the [#go channel](https://srct.slack.com/messages/go/details/) in SRCT's [Slack Group](https://srct.slack.com)
if you have any questions on setup or would like to contribute.
David Haynes's avatar
David Haynes committed
99 100


David Haynes's avatar
David Haynes committed
101
# Deployment
102 103 104 105 106 107

In order to expire links, you need to set up a cron job to run the manage.py
expirelinks command regularly. A sample cron script is available in the
repository and is named go-cleanlinks.cron. Drop this in cron.hourly and
change the paths so that they point to the virtualenv activate script and
manage.py.
David Haynes's avatar
David Haynes committed
108

David Haynes's avatar
David Haynes committed
109 110
---
**Note:**
David Haynes's avatar
David Haynes committed
111

112
Link by Viktor Vorobyev from the Noun Project.