Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit d52772b

Browse files
author
wimo7083
committed
Merge branch 'master' of https://github.com/OperationCode/operationcode_backend into fix_scope_conflict
2 parents 990d409 + 64d6a1b commit d52772b

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

config/native_setup_database.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# PostgreSQL. Versions 9.1 and up are supported.
2+
#
3+
# Install the pg driver:
4+
# gem install pg
5+
# On OS X with Homebrew:
6+
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7+
# On OS X with MacPorts:
8+
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9+
# On Windows:
10+
# gem install pg
11+
# Choose the win32 build.
12+
# Install PostgreSQL and put its /bin directory on your path.
13+
#
14+
# Configure Using Gemfile
15+
# gem 'pg'
16+
#
17+
default: &default
18+
adapter: postgresql
19+
encoding: unicode
20+
# For details on connection pooling, see rails configuration guide
21+
# http://guides.rubyonrails.org/configuring.html#database-pooling
22+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
23+
host: localhost
24+
25+
development:
26+
<<: *default
27+
database: operationcode_development
28+
29+
test:
30+
<<: *default
31+
database: operationcode_test
32+
33+
production:
34+
<<: *default
35+
host: <%= ENV['POSTGRES_HOST'].present? ? ENV['POSTGRES_HOST'] : 'operationcode-psql-postgresql' %>
36+
database: operationcode_production
37+
user: opcode_superuser
38+
password: <%= OperationCode.fetch_secret_with name: :postgres_password %>

docs/setup/native_setup.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Native Setup
2+
3+
### Git
4+
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](http://think-like-a-git.net/). If you find yourself in a real git pickle, see ["Oh, shit, git!"](http://ohshitgit.com/). 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.
5+
6+
* [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
7+
8+
### Code Base
9+
You are now ready for the actual **OperationCode Backend** code base.
10+
11+
* 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`).
12+
* 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](https://github.com/OperationCode/operationcode_backend) page.
13+
14+
* The following commands will pull down the source code from your forked repo.
15+
* Make sure to replace `[YOUR-GITHUB-NAME]` with your GitHub name. (example: https://github.com/iserbit/operationcode_backend.git)
16+
17+
#### Local Development Environment
18+
_Fork the repo first._
19+
```bash
20+
git clone https://github.com/[YOUR-GITHUB-NAME]/operationcode_backend.git operationcode-upstream
21+
cd operationcode-upstream
22+
git remote add upstream https://github.com/OperationCode/operationcode_backend.git
23+
```
24+
25+
1. If [Bundler](https://bundler.io/) is not installed run `gem install bundler`.
26+
2. Run `bundle install` to install all of the gems in your [Gemfile](Gemfile).
27+
3. Download and install [PostgreSQL](https://www.postgresql.org/download/) if you don't have it already.
28+
29+
#### Database Setup:
30+
31+
32+
1. Run `cp config/database.yml. config/native_setup_database.yml`.
33+
2. Run `bin/rake db:create`.
34+
3. Run `bin/rake db:migrate`.
35+
4. Run `bin/rake db:seed` --> **This is where I am getting errors** :sweat_smile:.
36+
37+
### Testing
38+
1. Run `RAILS_ENV=test rake db:test:prepare`.
39+
2. Run `bin/rake test & rubocop`.
40+
41+
#### Running OperationCode Backend:
42+
To run the OperationCode Backend simply type:
43+
```bash
44+
rails s
45+
```
46+
47+
You can now visit http://localhost:3000 and you should see the "Yay! You're on Rails!" welcome message.

0 commit comments

Comments
 (0)