-if pip list --outdated | grep "Latest" | wc -l > 0; then pip list --outdated && exit 1; else exit 0; fi
# - if pip list --outdated | grep "Latest" | wc -l > 0; then pip list --outdated && exit 1; else exit 0; fi
-coverage run --source=go --omit=*migrations/*,*admin.py,*manage.py,*wsgi.py,*settings.py,*secret.py,*__init__.py,*.pyc,*templates/*,*static/* manage.py test
-coverage run --source=go --omit=*migrations/*,*admin.py,*manage.py,*wsgi.py,*settings.py,*secret.py,*__init__.py,*.pyc,*templates/*,*static/* manage.py test
You'll want to follow the Vagrant setup method as it is designed to run on all platforms
I have successfully ran the project with Docker, though you need access to
including Windows.
Hyper-V which is only available on "Professional" versions of Windows.
I have also successfully ran the project with Docker, though you need
access to Hyper-V which is only available on "Professional" versions of Windows.
## 2) Clone the Go codebase.
## 2) Clone the Go codebase.
...
@@ -117,7 +112,7 @@ language.
...
@@ -117,7 +112,7 @@ language.
Instead of running a full VM that runs Go, we package up all the
Instead of running a full VM that runs Go, we package up all the
various bits that make up Go and run that as a container (two
various bits that make up Go and run that as a container (two
containers: one for Go and the other for mysql) that act as normal
containers: one for Go and the other for mysql) that act as normal
processes to the OS.
processes to the OS.
Check out [docker.com](https://www.docker.com/what-docker) for more details.
Check out [docker.com](https://www.docker.com/what-docker) for more details.
...
@@ -127,8 +122,7 @@ Pros:
...
@@ -127,8 +122,7 @@ Pros:
- Can be run on most machines without needing significant resources.
- Can be run on most machines without needing significant resources.
- SRCT members report minimal battery impact on laptops.
- SRCT members report minimal battery impact on laptops.
- Fast
- Fast
- Compared to other methods, Docker is comparatively faster than
- Compared to other methods, Docker is comparatively faster to setup than manual setup.
Vagrant or manual setup.
- Minimal setup
- Minimal setup
- You run one command. Really easy to get up and running once you install
- You run one command. Really easy to get up and running once you install
Docker.
Docker.
...
@@ -138,50 +132,13 @@ Pros:
...
@@ -138,50 +132,13 @@ Pros:
- Can easily destroy and rebuild the docker images
- Can easily destroy and rebuild the docker images
- Loads in changes to code on the fly
- Loads in changes to code on the fly
Cons:
- Challenging to debug problems
- Cannot interact with attached images and as a result, you cannot really
interact with the database.
There are instructions on how to setup/develop with Docker at the [docker-configuration page in the Go project wiki](https://git.gmu.edu/srct/go/wikis/docker-configuration).
There are instructions on how to setup/develop with Docker at the [docker-configuration page in the Go project wiki](https://git.gmu.edu/srct/go/wikis/docker-configuration).
### Vagrant + Ansible
Vagrant boots up a full virtual machine (VM) through VirtualBox that then runs Go. A
script written with Ansible will then run on that VM to automate the setup process
for you. It is similar in a way to running Go on a legitimate server.
Pros:
- Very similar to a production environment
- Can use `vagrant ssh` to "ssh" into the VM to debug things such as the
database.
- Relatively straightforward and easy setup.
- One Command.
- Can easily destroy and rebuild the VM.
- Loads in changes to code on the fly.
- Fast-ish (Initial provision takes a bit).
Cons:
- Heavier on resources.
- It's literally a full VM.
- Occasional issues/hiccups.
- Documented fixes are in the wiki.
There are instructions on how to setup with Vagrant at the [vagrant-configuration
page in the Go project wiki](https://git.gmu.edu/srct/go/wikis/vagrant-configuration).
Additionally, there is documentation about developing with Vagrant at
the [vagrant-usage page in the Go project wiki](https://git.gmu.edu/srct/go/wikis/vagrant-usage).
### Manual Setup
### Manual Setup
Manual setup (or: the old fashioned way) is where you install all dependecies on
Manual setup (or: the old fashioned way) is where you install all dependecies on
your system and run Go as a local server with Django. Granted you are technically
your system and run Go as a local server with Django. Granted you are technically
doing that with Vagrant and Docker except those platforms automate the steps that
doing that with Docker except it automates the steps that are laid out in this section.
are laid out in this section.
Pros:
Pros:
- Experience setting up a Django project for local development
- Experience setting up a Django project for local development
...
@@ -215,16 +172,6 @@ rely on. Here's how to run them locally:
...
@@ -215,16 +172,6 @@ rely on. Here's how to run them locally:
Docker is not supported currently for running unit tests. If you're able to get
Docker is not supported currently for running unit tests. If you're able to get
it set up, open a merge request and I'll merge it in.
it set up, open a merge request and I'll merge it in.
#### Vagrant
vagrant up
vagrant ssh
cd /vagrant
source venv/bin/activate
cd go
source sourceme.sh
python manage.py test
#### Manual Setup
#### Manual Setup
Assuming you are within your virtualenv:
Assuming you are within your virtualenv:
...
@@ -253,9 +200,9 @@ use the same username and Full Name as your main account and select "approved" i
...
@@ -253,9 +200,9 @@ use the same username and Full Name as your main account and select "approved" i
## Coding style
## Coding style
You should adhere to the style of the repo code. Consistancy is key! PEP8 guidelines
You should adhere to the style of the repo code. Consistency is key! PEP8 guidelines
are strongly reccomended but not enforced at the time. Please comment your code,
are strongly recommended but not enforced at the time. Please comment your code,
I will not accept commits that contain uncommented code.
I will not accept commits that contain undocumented code.