matross 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTU0MjU2YTZkOWEyN2M0NmMzYjE3YWQ4NTU3Yzk5ODNhMDkyYTYyOA==
4
+ MDMxMzlkYzllYjdmZDc0NmJiMTBlYzk2NzUxZjU1MzI3NTFhMTc1ZA==
5
5
  data.tar.gz: !binary |-
6
- NDk3YmEyZGEzZmU2ZTQwZTQyZWIyYjczNjIyYzhkYmQ1MWYwODk0Nw==
6
+ NjAwNzQyMzhmM2VkZTI1MDJkN2ZiOTFlMTVmNjA0NTYwNGM0OTQzYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTZkYjk3MWRlN2VmZjVkNDkzYjA5YzBiZjlkNzIyMjZiNzYwZmY4NTA2NjEz
10
- NTgzYjA2OGNlMThhNTAwN2M1ODcyNjhlMjA2NDgwOGJhNWRkNTU4N2Y1Mzc0
11
- OTQ2Y2ZhNDYxYWFiZjc5YjU2MWU0YWU2MDIyNjk4ZWVkNTRkZGU=
9
+ NjFkMjRiN2E2NWJiOTQ3YWM2MDE1Mzc1MTkxMGU4NzYwNzA3ZDE0YzMxNTNk
10
+ NGVmNGQ0ZjE0NDcyZTExODZjYTg5MzRmMGI0NzBhYTdhNDA1MDE2NzMxODhh
11
+ OTcxNjk1MTAxODZiYjVhYTZjY2MzMzdlODJhMDY4YzBjNTU0MTg=
12
12
  data.tar.gz: !binary |-
13
- ZDA5YmNmYmI0YzVkNjMxMDM0OTdkMGYxZGQ3YTgwNTNhNTIyMmE1ZGZhNWU5
14
- MGZkZDNjNGY1ODJjNjQ3MmRjZWIzM2MxMDViY2FiOTdiMmNlNWM3ZjY3MWFj
15
- NTlmYmYyMDk1MjgyODk3MDMzZDQ2ZTVlMWRjZWJmYTlhNGQzZTM=
13
+ OTA4Yzc1MWRjNGZiOWJiY2EwMjgzNzM0OTIwMGUwZTMyYjU1MjQ4MzcwNzgy
14
+ OWEwMGRjNjNkYjY4NmUxOTVlODQwMDU0ZWEwNTlmMTJkMjI4NzA2YjAxZjVj
15
+ NTJhYzljZmVkZGEyMGQyYWY2NjVhNjI3ODliODU2ZTM2Y2Q0MWI=
@@ -8,7 +8,7 @@ def template(from, to)
8
8
  else
9
9
  erb = File.read(File.expand_path("../templates/#{from}", __FILE__))
10
10
  end
11
- put ERB.new(erb).result(binding), to
11
+ put ERB.new(erb, nil, '-').result(binding), to
12
12
  end
13
13
 
14
14
  def dep_included?(dependency)
@@ -5,7 +5,13 @@ namespace :delayed_job do
5
5
  desc "Writes the delayed job part of the Procfile"
6
6
  task :procfile, :roles => :dj do
7
7
  procfile_template = <<-EOF.gsub(/^\s+/, '')
8
- dj: bundle exec rake jobs:work
8
+ <%- if exists?(:dj_queues) -%>
9
+ <%- dj_queues.each do |queue_name| -%>
10
+ dj_<%= queue_name %>: bundle exec rake jobs:work QUEUE=<%= queue_name %>
11
+ <%- end -%>
12
+ <%- else -%>
13
+ dj: bundle exec rake jobs:work
14
+ <%- end -%>
9
15
  EOF
10
16
  procfile = ERB.new(procfile_template, nil, '-')
11
17
  put procfile.result(binding), "#{shared_path}/Procfile.dj"
@@ -0,0 +1,33 @@
1
+ dep_included? 'faye'
2
+ dep_included? 'thin'
3
+
4
+ _cset(:faye_config) { "#{shared_path}/config/faye_server.yml" }
5
+ _cset(:faye_ru) { "#{shared_path}/config/faye.ru" }
6
+
7
+ namespace :faye do
8
+
9
+ desc "Creates the faye_server.yml in shared path"
10
+ task :setup, :roles => :app do
11
+ run "mkdir -p #{shared_path}/config"
12
+ template "faye/faye_server.yml.erb", faye_config
13
+ template "faye/faye.ru.erb", faye_ru
14
+ end
15
+ after "deploy:setup", "faye:setup"
16
+
17
+ desc "Updates the symlink for faye_server.yml for deployed release"
18
+ task :symlink, :roles => :app do
19
+ run "ln -nfs #{faye_config} #{release_path}/config/faye_server.yml"
20
+ end
21
+ after "bundle:install", "faye:symlink"
22
+
23
+ desc "Writes the faye part of the Procfile"
24
+ task :procfile, :roles => :faye do
25
+ procfile_template = <<-EOF.gsub(/^\s+/, '')
26
+ faye: bundle exec rackup <%= faye_ru %> -s thin -E <%= rails_env %> -p <%= faye_port %>
27
+ EOF
28
+ procfile = ERB.new(procfile_template, nil, '-')
29
+ put procfile.result(binding), "#{shared_path}/Procfile.faye"
30
+ end
31
+ after "foreman:pre_setup", "faye:procfile"
32
+
33
+ end
@@ -1,4 +1,9 @@
1
- _cset(:fog_config) { "#{shared_path}/config/fog_config.yml" }
1
+ dep_included? "fog"
2
+
3
+ _cset(:fog_config) { "#{shared_path}/config/fog_config.yml" }
4
+ _cset :fog_region, "us-east-1"
5
+ _cset :fog_public, false
6
+
2
7
  namespace :fog do
3
8
 
4
9
  desc "Creates the fog_config.yml in shared path"
@@ -82,6 +82,11 @@ namespace :foreman do
82
82
  end
83
83
  after "foreman:export", "foreman:log"
84
84
 
85
+ desc "Stop services"
86
+ task :stop, except: { no_release: true } do
87
+ run "#{sudo} stop #{application}"
88
+ end
89
+
85
90
  desc "Restart services"
86
91
  task :restart, except: { no_release: true } do
87
92
  run "#{sudo} start #{application} || #{sudo} restart #{application}"
@@ -0,0 +1,20 @@
1
+ dep_included? "mongoid"
2
+
3
+ _cset(:mongoid_config) { "#{shared_path}/config/mongoid.yml" }
4
+
5
+ namespace :mongoid do
6
+
7
+ desc "Creates the mongoid.yml file in shared path"
8
+ task :setup, :roles => :app do
9
+ run "mkdir -p #{shared_path}/config"
10
+ template "mongoid/mongoid.yml.erb", mongoid_config
11
+ end
12
+ after "deploy:setup", "mongoid:setup"
13
+
14
+ desc "Updates the symlink for mongoid.yml for deployed release"
15
+ task :symlink, :roles => :app do
16
+ run "ln -nfs #{mongoid_config} #{release_path}/config/mongoid.yml"
17
+ end
18
+ after "bundle:install", "mongoid:symlink"
19
+
20
+ end
@@ -0,0 +1,4 @@
1
+ require 'faye'
2
+ Faye::WebSocket.load_adapter('thin')
3
+ bayeux = Faye::RackAdapter.new(:mount => '/faye', :timeout => 25)
4
+ run bayeux
@@ -0,0 +1,6 @@
1
+ faye_server:
2
+ server: <%= roles[:faye].servers[0] %>
3
+ port: <%= faye_port %>
4
+ protocol: http
5
+ address: faye
6
+ local: <%= faye_local %>
@@ -1,5 +1,5 @@
1
1
  aws_access_key_id: <%= fog_aws_access_key_id %>
2
2
  aws_secret_access_key: <%= fog_aws_secret_access_key %>
3
3
  directory: <%= fog_directory %>
4
- region: <%= defined?(fog_region) ? fog_region : 'us-east-1' %>
5
- public: <%= defined?(fog_public) ? fog_public : false %>
4
+ region: <%= fog_region %>
5
+ public: <%= fog_public %>
@@ -0,0 +1,10 @@
1
+ <%= rails_env %>:
2
+ sessions:
3
+ default:
4
+ database: <%= mongo_database.gsub("-", "_") %>
5
+ hosts:
6
+ <%- mongo_hosts.each do |host| -%>
7
+ - <%= host %>
8
+ <%- end -%>
9
+ <% if exists?(:mongo_user) %>username: <%= mongo_user %><% end %>
10
+ <% if exists?(:mongo_passwd) %>password: <%= mongo_passwd %><% end %>
@@ -1,3 +1,3 @@
1
1
  module Matross
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matross
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artur Rodrigues
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-23 00:00:00.000000000 Z
12
+ date: 2013-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -71,14 +71,19 @@ files:
71
71
  - lib/matross/base.rb
72
72
  - lib/matross/delayed_job.rb
73
73
  - lib/matross/errors.rb
74
+ - lib/matross/faye.rb
74
75
  - lib/matross/fog.rb
75
76
  - lib/matross/foreman.rb
76
77
  - lib/matross/local_assets.rb
78
+ - lib/matross/mongoid.rb
77
79
  - lib/matross/mysql.rb
78
80
  - lib/matross/nginx.rb
79
81
  - lib/matross/templates/base/logrotate.erb
82
+ - lib/matross/templates/faye/faye.ru.erb
83
+ - lib/matross/templates/faye/faye_server.yml.erb
80
84
  - lib/matross/templates/fog/fog_config.yml.erb
81
85
  - lib/matross/templates/foreman/process.conf.erb
86
+ - lib/matross/templates/mongoid/mongoid.yml.erb
82
87
  - lib/matross/templates/mysql/database.yml.erb
83
88
  - lib/matross/templates/nginx/nginx_virtual_host_conf.erb
84
89
  - lib/matross/templates/unicorn/unicorn.rb.erb
@@ -105,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
110
  version: '0'
106
111
  requirements: []
107
112
  rubyforge_project:
108
- rubygems_version: 2.1.5
113
+ rubygems_version: 2.1.10
109
114
  signing_key:
110
115
  specification_version: 4
111
116
  summary: Our collection of opnionated Capistrano recipes