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

3
[![build status](https://git.gmu.edu/srct/go/badges/master/build.svg)](https://git.gmu.edu/srct/go/commits/master) [![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
4

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

David Haynes's avatar
David Haynes committed
7 8 9
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
10

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

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

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

David Haynes's avatar
David Haynes committed
21 22 23
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
24

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

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

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

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

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

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

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

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

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

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

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

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

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

David Haynes's avatar
David Haynes committed
54 55
**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
56

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

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

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

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

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

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

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

David Haynes's avatar
David Haynes committed
73
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
74

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

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

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

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

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

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

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

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

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

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


David Haynes's avatar
David Haynes committed
96 97
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
98 99


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

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
107

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

111
Link by Viktor Vorobyev from the Noun Project.