Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 3.79 KB

File metadata and controls

57 lines (39 loc) · 3.79 KB

Docker Setup

Docker is a container system. Click the appropriate link below to install Docker on your operating system.

Note that a full installation of the Docker Toolbox includes Git as well, which is also needed to work on the backend and is mentioned below.

Git

Git is a distributed version control system. This is how our code is stored and managed. Git can be frustrating, but it is an essential tool. If you want to learn more about Git, a great resource is Think Like a Git. If you find yourself in a real git pickle, see "Oh, shit, git!". If you have already installed Git as a part of the Docker Toolbox, you don't need to install it again using the following link.

Make (for Windows only)

Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. It is a standard part of the GNU library and is included in most distributions of Linux, as well as OSX. Unfortunately, Windows does not have a native make program, so it will need to be installed and added to PATH in order for the command line commands to work. You can use the GNUWin general installation guide as a general guide on how to install a GNU package and add it to PATH.

Code Base

You are now ready for the actual OperationCode Backend code base.

  • The common practice is to make a copy of the GitHub repository you want to work on (known as forking the repo), make your changes, and then request to merge those changes back into the project (known as a pull request).

  • Forking a repo is done through GitHub's web UI. It can be found in the top right corner of the OperationCode Backend's GitHub page.

  • The following commands will pull down the source code from your forked repo.

  • Make sure to replace [YOUR-GITHUB-NAME] with your GitHub name. (example: https://github.com/iserbit/operationcode_backend.git)

Local Development Environment

Fork the repo first.

git clone https://github.com/[YOUR-GITHUB-NAME]/operationcode_backend.git operationcode-upstream
cd operationcode-upstream
git remote add upstream https://github.com/OperationCode/operationcode_backend.git

Database Setup:

  1. Have the Docker app running
  2. Run make setup
  3. Run make test - recommended as it prepares your test env, and runs your tests initially.

If you run into any bundle install issues, run make bundle.

Running OperationCode Backend:

The OperationCode Backend has some handy shortcuts built in to make common tasks simple. You can check out the Makefile to see a full listing of what these shortcuts are and what they do.

To run the OperationCode Backend simply type:

make

You can now visit http://localhost:3000 (or run make open) and you should see a Rails welcome message!

In case you used the Docker Toolbox, you might have also installed VirtualBox, which creates its own virtual network adapters. In that case, the server might be running on that IP address and may not be reachable via localhost, 127.0.0.1 or even 0.0.0.0. So, you will need to use netstat on the command line to figure out the IP address on which the server is bound.