Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize Fisher Hall #77

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
.bundle

# Ignore bundler config.
/.bundle
.env.production

/build
apps/basechurch/build
apps/basechurch/coverage

/coverage

/db/*.sqlite3
/db/*.sqlite3-journal
/log/*.log
/tmp
/bin
/doc
apps/basechurch/db/*.sqlite3
apps/basechurch/db/*.sqlite3-journal
apps/basechurch/log/*.log
apps/basechurch/tmp
apps/basechurch/bin
apps/basechurch/doc
apps/basechurch/public

production-secrets.yml
development-secrets.yml
staging-secrets.yml
public

dump.rdb
config/secrets.yml

.DS_Store

apps/landing/target
apps/landing/out

**/.idea/workspace.xml
**/.idea/tasks.xml
**/.idea/*.iws

1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
language: ruby
rvm:
- 2.3.1
sudo: required

services:
- docker

script:
- RAILS_ENV=test bundle exec rake db:migrate --trace
- bundle exec rake
- ./bin/test-basechurch.sh
- ./bin/test-landing.sh

addons:
code_climate:
repo_token:
secure: eKtahgCOYZC/FzHgPSRYWLG/c7dRelaUZgCHV5TyoIn+akelAPRs+B334J8ahAfArLIVL2iUNpGQVdbDAMyQNd0BcQROkzj2qicGX5BTpaGRjDRHOVUDpevykZJl6oqy4WjvMevSp2xxY1ejZmbOwW/NzRQfSd79ekxGr+J0V/0=

notifications:
slack:
secure: G6VLedqT8kXanccqUeRRej2aXkR0SMFSwCBX/hbsNy+qoC7WSTFjMr98ijTn3eTykz1nBk+d2d2sfSm5dreIsl7jsF+eqHYKmZzGb13/YG6lvf2+GNyFduhoKJC3NWj1dqPO2QS+8g9YYBpGJIpnlp+PkSck5ewqd+mDXr53QbA=
39 changes: 0 additions & 39 deletions app/controllers/landing_controller.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/settings/redis_settings.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/settings/secrets.rb

This file was deleted.

9 changes: 9 additions & 0 deletions apps/basechurch/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
AWS_ACCESS_KEY_ID=test_aws_access_key_id
AWS_SECRET_ACCESS_KEY=test_aws_secret_access_key
DATABASE_HOST=db
DATABASE_USER=postgres
DATABASE_PASSWORD=
FB_APP_ID=a2222222222222
FB_APP_SECRET=a222222222333
PRERENDER_IO_TOKEN=test_prerender_token
SECRET_KEY_BASE=asdlkjfh23lkj4h23lkjehfsd7f8xc98zxvhxkvjhenrweefdxi99
9 changes: 9 additions & 0 deletions apps/basechurch/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
AWS_ACCESS_KEY_ID=test_aws_access_key_id
AWS_SECRET_ACCESS_KEY=test_aws_secret_access_key
DATABASE_HOST=db
DATABASE_USER=postgres
DATABASE_PASSWORD=
FB_APP_ID=a2222222222222
FB_APP_SECRET=a222222222333
PRERENDER_IO_TOKEN=test_prerender_token
SECRET_KEY_BASE=asdlkjfh23lkj4h23lkjehfsd7f8xc98zxvhxkvjhenrweefdxi99
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions apps/basechurch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ruby:2.3.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /app
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install
ADD . /app
1 change: 0 additions & 1 deletion Gemfile → apps/basechurch/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,4 @@ gem "rack-rewrite", "~> 1.5.0"
gem "rails", "~> 4.2.4"
gem "rails-api", "~> 0.3.1"
gem "settingslogic"
gem "sidekiq"
gem "validate_url", "~> 1.0.0"
15 changes: 0 additions & 15 deletions Gemfile.lock → apps/basechurch/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ GEM
simplecov (>= 0.7.1, < 1.0.0)
coderay (1.1.1)
concurrent-ruby (1.0.2)
connection_pool (2.2.0)
coveralls (0.8.15)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
Expand Down Expand Up @@ -290,8 +289,6 @@ GEM
websocket (~> 1.0)
rack (1.6.4)
rack-cors (0.4.0)
rack-protection (1.5.3)
rack
rack-rewrite (1.5.1)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -327,7 +324,6 @@ GEM
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
redis (3.3.1)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
rspec (3.5.0)
Expand Down Expand Up @@ -377,20 +373,11 @@ GEM
settingslogic (2.0.9)
sfl (2.2)
shellany (0.0.1)
sidekiq (4.1.4)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
redis (~> 3.2, >= 3.2.1)
sinatra (>= 1.4.7)
simplecov (0.12.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sinatra (1.4.7)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slop (3.6.0)
specinfra (2.61.2)
net-scp
Expand All @@ -415,7 +402,6 @@ GEM
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
timecop (0.8.1)
tins (1.12.0)
travis (1.5.8)
Expand Down Expand Up @@ -485,7 +471,6 @@ DEPENDENCIES
rspec_api_documentation
rubocop
settingslogic
sidekiq
spring
sqlite3
timecop
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def group_slug
end

def tags
@model.tag_list
@model.tag_list.sort
end

def tags=(tags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Api::V1::SermonResource < JSONAPI::Resource
has_one :group

def tags
@model.tag_list
@model.tag_list.sort
end

def tags=(tags)
Expand Down
4 changes: 4 additions & 0 deletions apps/basechurch/app/settings/secrets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Secrets < Settingslogic
source "#{Rails.root}/config/secrets.yml"
namespace Rails.env
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions apps/basechurch/config/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
default: &default
adapter: postgresql
database: mcac
encoding: utf8
host: <%= ENV["DATABASE_HOST"] %>
username: <%= ENV["DATABASE_USER"] %>
password: <%= ENV["DATABASE_PASSWORD"] %>
pool: 5

development:
<<: *default

test:
<<: *default
database: mcac_test

production:
<<: *default
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions apps/basechurch/config/secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
default: &default
aws_access_key_id: <%= ENV["AWS_ACCESS_KEY_ID"] %>
aws_secret_access_key: <%= ENV["AWS_SECRET_ACCESS_KEY"] %>
fb_app_id: <%= ENV["FB_APP_ID"] %>
fb_app_secret: <%= ENV["FB_APP_SECRET"] %>
prerender_io_token: <%= ENV["PRERENDER_IO_TOKEN"] %>
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

test: *default
development: *default
staging: *default
production: *default
File renamed without changes.
43 changes: 24 additions & 19 deletions db/schema.rb → apps/basechurch/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

ActiveRecord::Schema.define(version: 20161011033416) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "announcements", force: :cascade do |t|
t.integer "post_id"
t.integer "bulletin_id"
Expand All @@ -23,8 +26,8 @@
t.string "url"
end

add_index "announcements", ["bulletin_id"], name: "index_announcements_on_bulletin_id"
add_index "announcements", ["post_id"], name: "index_announcements_on_post_id"
add_index "announcements", ["bulletin_id"], name: "index_announcements_on_bulletin_id", using: :btree
add_index "announcements", ["post_id"], name: "index_announcements_on_post_id", using: :btree

create_table "attachments", force: :cascade do |t|
t.string "key"
Expand All @@ -35,7 +38,7 @@
t.datetime "updated_at"
end

add_index "attachments", ["attachable_type", "attachable_id"], name: "attachments_polymorphic_keys_index"
add_index "attachments", ["attachable_type", "attachable_id"], name: "attachments_polymorphic_keys_index", using: :btree

create_table "bulletins", force: :cascade do |t|
t.datetime "published_at"
Expand All @@ -49,7 +52,7 @@
t.integer "sermon_id"
end

add_index "bulletins", ["sermon_id"], name: "index_bulletins_on_sermon_id"
add_index "bulletins", ["sermon_id"], name: "index_bulletins_on_sermon_id", using: :btree

create_table "friendly_id_slugs", force: :cascade do |t|
t.string "slug", null: false
Expand All @@ -59,10 +62,10 @@
t.datetime "created_at"
end

add_index "friendly_id_slugs", ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
add_index "friendly_id_slugs", ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true, using: :btree
add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", using: :btree
add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id", using: :btree
add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree

create_table "groups", force: :cascade do |t|
t.string "name"
Expand All @@ -76,7 +79,7 @@
t.string "meet_details"
end

add_index "groups", ["slug"], name: "index_groups_on_slug", unique: true
add_index "groups", ["slug"], name: "index_groups_on_slug", unique: true, using: :btree

create_table "posts", force: :cascade do |t|
t.integer "group_id"
Expand All @@ -91,9 +94,9 @@
t.integer "kind", default: 0
end

add_index "posts", ["author_id"], name: "index_posts_on_author_id"
add_index "posts", ["editor_id"], name: "index_posts_on_editor_id"
add_index "posts", ["group_id"], name: "index_posts_on_group_id"
add_index "posts", ["author_id"], name: "index_posts_on_author_id", using: :btree
add_index "posts", ["editor_id"], name: "index_posts_on_editor_id", using: :btree
add_index "posts", ["group_id"], name: "index_posts_on_group_id", using: :btree

create_table "sermons", force: :cascade do |t|
t.integer "group_id"
Expand All @@ -106,7 +109,7 @@
t.datetime "updated_at", null: false
end

add_index "sermons", ["group_id"], name: "index_sermons_on_group_id"
add_index "sermons", ["group_id"], name: "index_sermons_on_group_id", using: :btree

create_table "taggings", force: :cascade do |t|
t.integer "tag_id"
Expand All @@ -118,15 +121,15 @@
t.datetime "created_at"
end

add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree

create_table "tags", force: :cascade do |t|
t.string "name"
t.integer "taggings_count", default: 0
end

add_index "tags", ["name"], name: "index_tags_on_name", unique: true
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree

create_table "users", force: :cascade do |t|
t.string "provider", null: false
Expand All @@ -153,8 +156,10 @@
t.datetime "updated_at"
end

add_index "users", ["email"], name: "index_users_on_email"
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
add_index "users", ["uid", "provider"], name: "index_users_on_uid_and_provider", unique: true
add_index "users", ["email"], name: "index_users_on_email", using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
add_index "users", ["uid", "provider"], name: "index_users_on_uid_and_provider", unique: true, using: :btree

add_foreign_key "bulletins", "sermons"
add_foreign_key "sermons", "groups"
end
File renamed without changes.
Loading