diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-02 21:39:57 -0400 | 
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-02 21:39:57 -0400 | 
| commit | 79d9cd3c5e3764db9d3506e1702042a7a7a4aea3 (patch) | |
| tree | 3a83e1e9f4b307199b95de86a28f58eb0f40ae04 /config | |
| parent | 9cf94eec5ae98f750f9babc0c37373df87e3981c (diff) | |
| download | thoughts-79d9cd3c5e3764db9d3506e1702042a7a7a4aea3.tar.gz thoughts-79d9cd3c5e3764db9d3506e1702042a7a7a4aea3.tar.bz2 thoughts-79d9cd3c5e3764db9d3506e1702042a7a7a4aea3.zip | |
Set up Capistrano
Diffstat (limited to 'config')
| -rw-r--r-- | config/database.yml | 25 | ||||
| -rw-r--r-- | config/deploy.rb | 43 | ||||
| -rw-r--r-- | config/deploy/production.rb | 62 | ||||
| -rw-r--r-- | config/deploy/staging.rb | 61 | ||||
| -rw-r--r-- | config/initializers/mysql_utf8mb4_fix.rb | 9 | 
5 files changed, 175 insertions, 25 deletions
| diff --git a/config/database.yml b/config/database.yml deleted file mode 100644 index 0d02f24..0000000 --- a/config/database.yml +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | # SQLite version 3.x | ||
| 2 | # gem install sqlite3 | ||
| 3 | # | ||
| 4 | # Ensure the SQLite 3 gem is defined in your Gemfile | ||
| 5 | # gem 'sqlite3' | ||
| 6 | # | ||
| 7 | default: &default | ||
| 8 | adapter: sqlite3 | ||
| 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | ||
| 10 | timeout: 5000 | ||
| 11 | |||
| 12 | development: | ||
| 13 | <<: *default | ||
| 14 | database: db/development.sqlite3 | ||
| 15 | |||
| 16 | # Warning: The database defined as "test" will be erased and | ||
| 17 | # re-generated from your development database when you run "rake". | ||
| 18 | # Do not set this db to the same as development or production. | ||
| 19 | test: | ||
| 20 | <<: *default | ||
| 21 | database: db/test.sqlite3 | ||
| 22 | |||
| 23 | production: | ||
| 24 | <<: *default | ||
| 25 | database: db/production.sqlite3 | ||
| diff --git a/config/deploy.rb b/config/deploy.rb new file mode 100644 index 0000000..16c6257 --- /dev/null +++ b/config/deploy.rb | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | # config valid only for current version of Capistrano | ||
| 2 | lock "3.8.1" | ||
| 3 | |||
| 4 | set :application, "thoughts" | ||
| 5 | set :repo_url, "git@github.com:hatkirby/thoughts.git" | ||
| 6 | |||
| 7 | # Default branch is :master | ||
| 8 | # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp | ||
| 9 | |||
| 10 | # Default deploy_to directory is /var/www/my_app_name | ||
| 11 | set :deploy_to, "/srv/www/thoughts" | ||
| 12 | |||
| 13 | # Default value for :format is :airbrussh. | ||
| 14 | # set :format, :airbrussh | ||
| 15 | |||
| 16 | # You can configure the Airbrussh format using :format_options. | ||
| 17 | # These are the defaults. | ||
| 18 | # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto | ||
| 19 | |||
| 20 | # Default value for :pty is false | ||
| 21 | # set :pty, true | ||
| 22 | |||
| 23 | # Default value for :linked_files is [] | ||
| 24 | append :linked_files, "config/database.yml" | ||
| 25 | |||
| 26 | # Default value for linked_dirs is [] | ||
| 27 | append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/uploads" | ||
| 28 | |||
| 29 | # Default value for default_env is {} | ||
| 30 | # set :default_env, { path: "/opt/ruby/bin:$PATH" } | ||
| 31 | |||
| 32 | # Default value for keep_releases is 5 | ||
| 33 | # set :keep_releases, 5 | ||
| 34 | |||
| 35 | # rvm | ||
| 36 | set :rvm_type, :system | ||
| 37 | set :rvm_custom_path, '/usr/local/rvm' | ||
| 38 | |||
| 39 | # rails | ||
| 40 | set :rails_env, 'production' | ||
| 41 | set :conditionally_migrate, true | ||
| 42 | set :migration_role, :app | ||
| 43 | set :assets_roles, [:app] | ||
| diff --git a/config/deploy/production.rb b/config/deploy/production.rb new file mode 100644 index 0000000..6475c07 --- /dev/null +++ b/config/deploy/production.rb | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | # server-based syntax | ||
| 2 | # ====================== | ||
| 3 | # Defines a single server with a list of roles and multiple properties. | ||
| 4 | # You can define all roles on a single server, or split them: | ||
| 5 | |||
| 6 | # server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value | ||
| 7 | # server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value | ||
| 8 | # server "db.example.com", user: "deploy", roles: %w{db} | ||
| 9 | server "feffernoo.se", user: "thoughts", roles: %w{app db web} | ||
| 10 | |||
| 11 | |||
| 12 | |||
| 13 | # role-based syntax | ||
| 14 | # ================== | ||
| 15 | |||
| 16 | # Defines a role with one or multiple servers. The primary server in each | ||
| 17 | # group is considered to be the first unless any hosts have the primary | ||
| 18 | # property set. Specify the username and a domain or IP for the server. | ||
| 19 | # Don't use `:all`, it's a meta role. | ||
| 20 | |||
| 21 | # role :app, %w{deploy@example.com}, my_property: :my_value | ||
| 22 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value | ||
| 23 | # role :db, %w{deploy@example.com} | ||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | # Configuration | ||
| 28 | # ============= | ||
| 29 | # You can set any configuration variable like in config/deploy.rb | ||
| 30 | # These variables are then only loaded and set in this stage. | ||
| 31 | # For available Capistrano configuration variables see the documentation page. | ||
| 32 | # http://capistranorb.com/documentation/getting-started/configuration/ | ||
| 33 | # Feel free to add new variables to customise your setup. | ||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | # Custom SSH Options | ||
| 38 | # ================== | ||
| 39 | # You may pass any option but keep in mind that net/ssh understands a | ||
| 40 | # limited set of options, consult the Net::SSH documentation. | ||
| 41 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start | ||
| 42 | # | ||
| 43 | # Global options | ||
| 44 | # -------------- | ||
| 45 | # set :ssh_options, { | ||
| 46 | # keys: %w(/home/rlisowski/.ssh/id_rsa), | ||
| 47 | # forward_agent: false, | ||
| 48 | # auth_methods: %w(password) | ||
| 49 | # } | ||
| 50 | # | ||
| 51 | # The server-based syntax can be used to override options: | ||
| 52 | # ------------------------------------ | ||
| 53 | # server "example.com", | ||
| 54 | # user: "user_name", | ||
| 55 | # roles: %w{web app}, | ||
| 56 | # ssh_options: { | ||
| 57 | # user: "user_name", # overrides user setting above | ||
| 58 | # keys: %w(/home/user_name/.ssh/id_rsa), | ||
| 59 | # forward_agent: false, | ||
| 60 | # auth_methods: %w(publickey password) | ||
| 61 | # # password: "please use keys" | ||
| 62 | # } | ||
| diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb new file mode 100644 index 0000000..4bb7a71 --- /dev/null +++ b/config/deploy/staging.rb | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | # server-based syntax | ||
| 2 | # ====================== | ||
| 3 | # Defines a single server with a list of roles and multiple properties. | ||
| 4 | # You can define all roles on a single server, or split them: | ||
| 5 | |||
| 6 | # server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value | ||
| 7 | # server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value | ||
| 8 | # server "db.example.com", user: "deploy", roles: %w{db} | ||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | # role-based syntax | ||
| 13 | # ================== | ||
| 14 | |||
| 15 | # Defines a role with one or multiple servers. The primary server in each | ||
| 16 | # group is considered to be the first unless any hosts have the primary | ||
| 17 | # property set. Specify the username and a domain or IP for the server. | ||
| 18 | # Don't use `:all`, it's a meta role. | ||
| 19 | |||
| 20 | # role :app, %w{deploy@example.com}, my_property: :my_value | ||
| 21 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value | ||
| 22 | # role :db, %w{deploy@example.com} | ||
| 23 | |||
| 24 | |||
| 25 | |||
| 26 | # Configuration | ||
| 27 | # ============= | ||
| 28 | # You can set any configuration variable like in config/deploy.rb | ||
| 29 | # These variables are then only loaded and set in this stage. | ||
| 30 | # For available Capistrano configuration variables see the documentation page. | ||
| 31 | # http://capistranorb.com/documentation/getting-started/configuration/ | ||
| 32 | # Feel free to add new variables to customise your setup. | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | # Custom SSH Options | ||
| 37 | # ================== | ||
| 38 | # You may pass any option but keep in mind that net/ssh understands a | ||
| 39 | # limited set of options, consult the Net::SSH documentation. | ||
| 40 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start | ||
| 41 | # | ||
| 42 | # Global options | ||
| 43 | # -------------- | ||
| 44 | # set :ssh_options, { | ||
| 45 | # keys: %w(/home/rlisowski/.ssh/id_rsa), | ||
| 46 | # forward_agent: false, | ||
| 47 | # auth_methods: %w(password) | ||
| 48 | # } | ||
| 49 | # | ||
| 50 | # The server-based syntax can be used to override options: | ||
| 51 | # ------------------------------------ | ||
| 52 | # server "example.com", | ||
| 53 | # user: "user_name", | ||
| 54 | # roles: %w{web app}, | ||
| 55 | # ssh_options: { | ||
| 56 | # user: "user_name", # overrides user setting above | ||
| 57 | # keys: %w(/home/user_name/.ssh/id_rsa), | ||
| 58 | # forward_agent: false, | ||
| 59 | # auth_methods: %w(publickey password) | ||
| 60 | # # password: "please use keys" | ||
| 61 | # } | ||
| diff --git a/config/initializers/mysql_utf8mb4_fix.rb b/config/initializers/mysql_utf8mb4_fix.rb new file mode 100644 index 0000000..8388027 --- /dev/null +++ b/config/initializers/mysql_utf8mb4_fix.rb | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | require 'active_record/connection_adapters/abstract_mysql_adapter' | ||
| 2 | |||
| 3 | module ActiveRecord | ||
| 4 | module ConnectionAdapters | ||
| 5 | class AbstractMysqlAdapter | ||
| 6 | NATIVE_DATABASE_TYPES[:string] = { :name => "varchar", :limit => 191 } | ||
| 7 | end | ||
| 8 | end | ||
| 9 | end | ||
