Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 7effe90

Browse files
initial commit
0 parents  commit 7effe90

File tree

134 files changed

+2528
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+2528
-0
lines changed

Diff for: .gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore all logfiles and tempfiles.
11+
/log/*
12+
/tmp/*
13+
!/log/.keep
14+
!/tmp/.keep
15+
16+
# Ignore Byebug command history file.
17+
.byebug_history
18+
19+
# Ignore test reports
20+
/brakeman-output.*
21+
/coverage
22+
23+
# Ignore results of `rake assets:precompile`.
24+
/public/assets/
25+
26+
# Never check passwords into source control!
27+
/config/database.yml
28+
/.env

Diff for: .overcommit.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Use this file to configure the Overcommit hooks you wish to use. This will
2+
# extend the default configuration defined in:
3+
# https://github.com/brigade/overcommit/blob/master/config/default.yml
4+
#
5+
# At the topmost level of this YAML file is a key representing type of hook
6+
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
7+
# customize each hook, such as whether to only run it on certain files (via
8+
# `include`), whether to only display output if it fails (via `quiet`), etc.
9+
#
10+
# For a complete list of hooks, see:
11+
# https://github.com/brigade/overcommit/tree/master/lib/overcommit/hook
12+
#
13+
# For a complete list of options that you can use to customize hooks, see:
14+
# https://github.com/brigade/overcommit#configuration
15+
#
16+
# Uncomment the following lines to make the configuration take effect.
17+
18+
gemfile: Gemfile
19+
20+
PreCommit:
21+
BundleCheck:
22+
enabled: true
23+
24+
LocalPathsInGemfile:
25+
enabled: true
26+
27+
RailsSchemaUpToDate:
28+
enabled: true
29+
30+
RuboCop:
31+
enabled: true
32+
on_warn: fail
33+
34+
TrailingWhitespace:
35+
enabled: true
36+
exclude:
37+
- "**/db/structure.sql"
38+
39+
YamlSyntax:
40+
enabled: true
41+
42+
PostCheckout:
43+
ALL:
44+
quiet: true

Diff for: .ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.3.0

Diff for: .simplecov

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require "simplecov"
2+
SimpleCov.start("rails") do
3+
add_filter("/bin/")
4+
add_filter("/lib/tasks/auto_annotate_models.rake")
5+
add_filter("/lib/tasks/coverage.rake")
6+
end
7+
SimpleCov.minimum_coverage(90)
8+
SimpleCov.use_merging(false)

Diff for: Capfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Load DSL and set up stages
2+
require "capistrano/setup"
3+
4+
# Include default deployment tasks
5+
require "capistrano/deploy"
6+
7+
# Include tasks from other gems included in your Gemfile
8+
require "airbrussh/capistrano"
9+
require "capistrano/bundler"
10+
require "capistrano/rails"
11+
require "capistrano/mb"
12+
require "capistrano-nc/nc"
13+
14+
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
15+
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

Diff for: DEPLOYMENT.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# How to deploy mena-devs_com
2+
3+
This document covers the steps need to deploy the application to an existing environment. To create a new environment, refer to `PROVISIONING.md`.
4+
5+
* **Developers:** this project is built and deployed using Capistrano, which is the `cap` command. Refer to the *Capistrano* section.
6+
* **System administrators:** once deployed, the various processes and configuration can be maintained with familiar Linux commands. Refer to the *Server maintenance* section.
7+
8+
9+
## Capistrano
10+
11+
### Environments
12+
13+
* **staging** is deployed from the `development` branch.
14+
* **production** is deployed from the `master` branch.
15+
16+
### Prerequisites
17+
18+
Capistrano runs on your local machine and uses SSH to perform the deployment on the remote server. Therefore:
19+
20+
* The Capistrano gem must be installed (see `README.md` for project setup instructions).
21+
* You must have SSH access to the production/staging server.
22+
* Your SSH key must be installed on the server in `~deployer/.ssh/authorized_keys`.
23+
* You must have SSH access to Git repository (using your SSH key).
24+
25+
### Performing a graceful deployment (no migrations)
26+
27+
This will deploy the latest code from `development`. Make sure to `git push` your changes first, or they will not apply.
28+
29+
```
30+
bundle exec cap production deploy
31+
```
32+
33+
### Performing a full deployment
34+
35+
If there are data migrations or other changes that require downtime, perform the deployment using the following task:
36+
37+
```
38+
bundle exec cap production deploy:migrate_and_restart
39+
```
40+
41+
This will stop the app and display a maintenance page during the deployment.
42+
43+
44+
## Server maintenance
45+
46+
This application consists of two executables that run as the `deployer` user:
47+
48+
* Unicorn is the application server that services Rails HTTP requests
49+
* Sidekiq is the background worker that services the job queue stored in Redis
50+
51+
These in turn rely on the following services:
52+
53+
* PostgreSQL
54+
* Redis
55+
* Nginx
56+
57+
### Controlling processes
58+
59+
All processes are set up to start automatically when the server boots, and can be controlled using the standard Ubuntu `service` command:
60+
61+
```
62+
sudo service postgresql <start|stop|restart>
63+
sudo service nginx <start|stop|restart>
64+
sudo service unicorn_mena_devs_com <start|stop|restart>
65+
sudo service sidekiq_mena_devs_com <start|stop>
66+
```
67+
68+
Note that Unicorn and Sidekiq require access to PostgreSQL and Redis, so those supporting services should be started first.
69+
70+
### Configuration
71+
72+
All configuration values required by the application can be changed here:
73+
74+
```
75+
/home/deployer/apps/mena_devs_com/shared/.env.production
76+
```
77+
78+
After making changes to this file, be sure to restart the application:
79+
80+
```
81+
sudo service unicorn_mena_devs_com restart
82+
sudo service sidekiq_mena_devs_com stop
83+
sudo service sidekiq_mena_devs_com start
84+
```

Diff for: Gemfile

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
source "https://rubygems.org"
2+
3+
gem "active_type", ">= 0.3.2"
4+
gem "autoprefixer-rails", ">= 5.0.0.1"
5+
gem "bcrypt", "~> 3.1.7"
6+
gem "bootstrap_form", "~> 2.3"
7+
gem "bootstrap-sass", "~> 3.3"
8+
gem "bootscale", :require => false
9+
gem "coffee-rails", "~> 4.2"
10+
gem "dotenv-rails", ">= 2.0.0"
11+
gem "font-awesome-rails"
12+
gem "jquery-rails"
13+
gem "mail", ">= 2.6.3"
14+
gem "marco-polo"
15+
gem "pg", "~> 0.18"
16+
gem "pgcli-rails"
17+
gem "rails", "5.0.0.1"
18+
gem "redis-namespace"
19+
gem "sass-rails", "~> 5.0"
20+
gem "secure_headers", "~> 3.0"
21+
gem "sidekiq", ">= 4.2.0"
22+
gem "turbolinks", "~> 5"
23+
24+
group :production, :staging do
25+
gem "postmark-rails"
26+
gem "unicorn"
27+
gem "unicorn-worker-killer"
28+
end
29+
30+
group :development do
31+
gem "annotate", ">= 2.5.0"
32+
gem "awesome_print"
33+
gem "better_errors"
34+
gem "binding_of_caller"
35+
gem "brakeman", :require => false
36+
gem "bundler-audit", ">= 0.5.0", :require => false
37+
gem "capistrano", "~> 3.6", :require => false
38+
gem "capistrano-bundler", "~> 1.2", :require => false
39+
gem "capistrano-mb", ">= 0.22.2", :require => false
40+
gem "capistrano-nc", :require => false
41+
gem "capistrano-rails", :require => false
42+
gem "guard", ">= 2.2.2", :require => false
43+
gem "guard-livereload", :require => false
44+
gem "guard-minitest", :require => false
45+
gem "letter_opener"
46+
gem "listen", "~> 3.0.5"
47+
gem "overcommit", :require => false
48+
gem "puma", "~> 3.0"
49+
gem "rack-livereload"
50+
gem "rb-fsevent", :require => false
51+
gem "rubocop", :require => false
52+
gem "simplecov", :require => false
53+
gem "spring"
54+
gem "sshkit", "~> 1.8", :require => false
55+
gem "spring-watcher-listen", "~> 2.0.0"
56+
gem "terminal-notifier", :require => false
57+
gem "terminal-notifier-guard", :require => false
58+
gem "xray-rails", ">= 0.1.18"
59+
end
60+
61+
group :test do
62+
gem "capybara"
63+
gem "connection_pool"
64+
gem "launchy"
65+
gem "minitest-capybara"
66+
gem "minitest-reporters"
67+
gem "mocha"
68+
gem "poltergeist"
69+
gem "shoulda-context"
70+
gem "shoulda-matchers", ">= 3.0.1"
71+
end

0 commit comments

Comments
 (0)