matross 0.2.5 → 0.2.6

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
- MDMxMzlkYzllYjdmZDc0NmJiMTBlYzk2NzUxZjU1MzI3NTFhMTc1ZA==
4
+ MGJkNDFkNjgyNTMwMjVhZWE4ZWUzZGQzYjg2YjY0MzI2ODJhNzZlMg==
5
5
  data.tar.gz: !binary |-
6
- NjAwNzQyMzhmM2VkZTI1MDJkN2ZiOTFlMTVmNjA0NTYwNGM0OTQzYQ==
6
+ MDFhYTAwZmQxYTgxMDg2NGU4Njc5MTA5MzNjMjAyYTczYmJkMTEwNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjFkMjRiN2E2NWJiOTQ3YWM2MDE1Mzc1MTkxMGU4NzYwNzA3ZDE0YzMxNTNk
10
- NGVmNGQ0ZjE0NDcyZTExODZjYTg5MzRmMGI0NzBhYTdhNDA1MDE2NzMxODhh
11
- OTcxNjk1MTAxODZiYjVhYTZjY2MzMzdlODJhMDY4YzBjNTU0MTg=
9
+ ZWFiMDdjMWY4MWFkMGZjYzhiMzI5MDMyYTZkNzNiNTg4Mjk3ZTRhM2Y0NjZi
10
+ NjZiMjIwZWRjNzRjMDFmM2ZkOGJmODAzMWFiN2JkNWNjZDAyNmM2NjEzY2Ux
11
+ ODU5MGI3ZDkzNzRmZjllNDgzN2UyNTA0YTUyOTJhZmFmNDlkOGM=
12
12
  data.tar.gz: !binary |-
13
- OTA4Yzc1MWRjNGZiOWJiY2EwMjgzNzM0OTIwMGUwZTMyYjU1MjQ4MzcwNzgy
14
- OWEwMGRjNjNkYjY4NmUxOTVlODQwMDU0ZWEwNTlmMTJkMjI4NzA2YjAxZjVj
15
- NTJhYzljZmVkZGEyMGQyYWY2NjVhNjI3ODliODU2ZTM2Y2Q0MWI=
13
+ MWNkNmFiYzE1MDYyNWZhMDQxNTJhZmI0MzA2OGZlNjMxOWNhMWJlOTUyMzI1
14
+ MTM1NzliYzA0NzQ3ZGZlNDJlY2ZjOGRiZTNkYmFkNDgzMjM4ODcwZWE3Nzli
15
+ MzUyM2E0M2M5NDM5YTdhNWY5MDJhNjQwY2RkYWViODE1M2E4ZWU=
data/lib/matross/base.rb CHANGED
@@ -12,7 +12,7 @@ def template(from, to)
12
12
  end
13
13
 
14
14
  def dep_included?(dependency)
15
- lockfile = Bundler::LockfileParser.new(Bundler.read_file(Bundler.default_lockfile))
15
+ lockfile = Bundler::LockfileParser.new(Bundler.read_file(Bundler.default_lockfile))
16
16
  if not lockfile.specs.any? { |gem| gem.name == dependency} then
17
17
  raise Matross::MissingDepError, "recipe requires the #{dependency} gem"
18
18
  end
@@ -26,5 +26,4 @@ namespace :base do
26
26
  run "#{sudo} ln -nfs #{shared_path}/config/logrotate /etc/logrotate.d/#{application}"
27
27
  end
28
28
  after "deploy:setup", "base:logrotate"
29
-
30
29
  end
@@ -17,5 +17,4 @@ namespace :delayed_job do
17
17
  put procfile.result(binding), "#{shared_path}/Procfile.dj"
18
18
  end
19
19
  after "foreman:pre_setup", "delayed_job:procfile"
20
-
21
20
  end
data/lib/matross/faye.rb CHANGED
@@ -29,5 +29,4 @@ namespace :faye do
29
29
  put procfile.result(binding), "#{shared_path}/Procfile.faye"
30
30
  end
31
31
  after "foreman:pre_setup", "faye:procfile"
32
-
33
32
  end
data/lib/matross/fog.rb CHANGED
@@ -18,5 +18,4 @@ namespace :fog do
18
18
  run "ln -nfs #{fog_config} #{release_path}/config/fog_config.yml"
19
19
  end
20
20
  after "bundle:install", "fog:symlink"
21
-
22
21
  end
@@ -98,5 +98,4 @@ namespace :foreman do
98
98
  run "cd #{shared_path}/upstart && rm -f Procfile*"
99
99
  run "cd /etc/init/ && #{sudo} rm #{application}*"
100
100
  end
101
-
102
101
  end
@@ -20,7 +20,5 @@ namespace :deploy do
20
20
  RAILS_ENV=#{rails_env.to_s.shellescape} #{rake} assets:clean
21
21
  CMD
22
22
  end
23
-
24
23
  end
25
-
26
24
  end
@@ -16,5 +16,4 @@ namespace :mongoid do
16
16
  run "ln -nfs #{mongoid_config} #{release_path}/config/mongoid.yml"
17
17
  end
18
18
  after "bundle:install", "mongoid:symlink"
19
-
20
19
  end
data/lib/matross/mysql.rb CHANGED
@@ -2,20 +2,20 @@ dep_included? 'mysql2'
2
2
 
3
3
  _cset(:database_config) { "#{shared_path}/config/database.yml" }
4
4
 
5
- namespace :db do
5
+ namespace :mysql do
6
6
 
7
7
  desc "Creates the database.yml file in shared path"
8
8
  task :setup, :roles => [:app, :dj] do
9
9
  run "mkdir -p #{shared_path}/config"
10
10
  template "mysql/database.yml.erb", database_config
11
11
  end
12
- after "deploy:setup", "db:setup"
12
+ after "deploy:setup", "mysql:setup"
13
13
 
14
14
  desc "Updates the symlink for database.yml for deployed release"
15
15
  task :symlink, :roles => [:app, :dj] do
16
16
  run "ln -nfs #{database_config} #{release_path}/config/database.yml"
17
17
  end
18
- after "bundle:install", "db:symlink"
18
+ after "bundle:install", "mysql:symlink"
19
19
 
20
20
  desc "Creates the application database"
21
21
  task :create, :roles => [:db] do
@@ -24,7 +24,7 @@ namespace :db do
24
24
  EOF
25
25
  run "mysql --user=#{mysql_user} --password=#{mysql_passwd} --host=#{mysql_host} --execute=\"#{sql}\""
26
26
  end
27
- after "db:setup", "db:create"
27
+ after "mysql:setup", "mysql:create"
28
28
 
29
29
  desc "Loads the application schema into the database"
30
30
  task :schema_load, :roles => [:db] do
@@ -39,5 +39,5 @@ namespace :db do
39
39
  run "cd #{release_path} &&"\
40
40
  "RAILS_ENV=#{rails_env.to_s.shellescape} bundle exec rake db:schema:load" if table_count == 0
41
41
  end
42
- after "db:symlink", "db:schema_load"
42
+ after "mysql:symlink", "mysql:schema_load"
43
43
  end
data/lib/matross/nginx.rb CHANGED
@@ -14,5 +14,18 @@ namespace :nginx do
14
14
  run "#{sudo} /etc/init.d/nginx reload"
15
15
  end
16
16
  after "deploy:setup", "nginx:reload"
17
+ after "nginx:lock", "nginx:reload"
18
+ after "nginx:unlock", "nginx:reload"
17
19
 
20
+ desc "Enable Basic Auth on the stage"
21
+ task :lock, :roles => :web do
22
+ run "#{sudo} sed -i /auth_basic/d /etc/nginx/sites-available/#{application}"
23
+ nginx_lock = " auth_basic \"Restricted\";\n auth_basic_user_file #{shared_path.gsub('/', '\\/')}\\/.htpasswd;"
24
+ run "#{sudo} sed -i 's/.*location @#{application}.*/&\n#{nginx_lock}/' /etc/nginx/sites-available/#{application}"
25
+ run "echo #{htpasswd.shellescape} > #{shared_path}/.htpasswd"
26
+ end
27
+
28
+ task :unlock, :roles => :web do
29
+ run "#{sudo} sed -i /auth_basic/d /etc/nginx/sites-available/#{application}"
30
+ end
18
31
  end
@@ -8,7 +8,7 @@ server {
8
8
  server_name <%= server_name %>;
9
9
 
10
10
  keepalive_timeout 5;
11
- root <%= "#{deploy_to}/current/public" %>;
11
+ root <%= deploy_to %>/current/public;
12
12
  try_files $uri @<%= application %>;
13
13
 
14
14
  location @<%= application %> {
@@ -26,6 +26,6 @@ server {
26
26
 
27
27
  error_page 500 502 504 /500.html;
28
28
  location = /500.html {
29
- root /home/ubuntu/vandal/current/public;
29
+ root <%= deploy_to %>/current/public;
30
30
  }
31
31
  }
@@ -22,5 +22,4 @@ namespace :unicorn do
22
22
  put procfile.result(binding), "#{shared_path}/Procfile.web"
23
23
  end
24
24
  after "foreman:pre_setup", "unicorn:procfile"
25
-
26
25
  end
@@ -1,3 +1,3 @@
1
1
  module Matross
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
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.5
4
+ version: 0.2.6
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-30 00:00:00.000000000 Z
12
+ date: 2013-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler