capobvious 0.2.6 → 0.2.7

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.
@@ -184,6 +184,7 @@ Capistrano::Configuration.instance.load do
184
184
  if adapter == "postgresql"
185
185
  run "echo \"create user #{db_username} with password '#{db_password}';\" | #{sudo} -u postgres psql"
186
186
  run "echo \"create database #{database} owner #{db_username};\" | #{sudo} -u postgres psql"
187
+ run "echo \"CREATE EXTENSION IF NOT EXISTS hstore;\" | #{sudo} -u postgres psql #{database}" if exists?(:hstore) && fetch(:hstore) == true
187
188
  else
188
189
  puts "Cannot create, adapter #{adapter} is not implemented yet"
189
190
  end
@@ -468,8 +469,14 @@ Capistrano::Configuration.instance.load do
468
469
  run "which #{name}"
469
470
  end
470
471
 
471
-
472
472
  namespace :runit do
473
+ [:stop, :start, :restart, :reload].each do |action|
474
+ desc "#{action.to_s} runit"
475
+ task action, :roles => :web do
476
+ run "#{sudo} sv #{action.to_s} #{application}"
477
+ end
478
+ end
479
+
473
480
  desc "init"
474
481
  task :init, :roles => :web do
475
482
  join_ruby = rvm_ruby_string[/\d.\d.\d/].delete('.')
@@ -480,7 +487,7 @@ Capistrano::Configuration.instance.load do
480
487
  logger.important('Creating unicorn wrapper', 'runit')
481
488
  run "rvm wrapper #{rvm_ruby_string} #{join_ruby} unicorn"
482
489
 
483
- run = <<EOF
490
+ runit_run = <<EOF
484
491
  #!/bin/sh
485
492
  exec 2>&1
486
493
  export USER=#{user}
@@ -501,7 +508,7 @@ EOF
501
508
  logger.important('Creating local runit path', 'runit')
502
509
  run "mkdir -p #{local_runit_path}/log"
503
510
  logger.important('Creating run script', 'runit')
504
- put run, "#{local_runit_path}/run"
511
+ put runit_run, "#{local_runit_path}/run"
505
512
  run "chmod +x #{local_runit_path}/run"
506
513
  logger.important('Creating log script', 'runit')
507
514
  put log_run, "#{local_runit_path}/log/run"
@@ -1,3 +1,3 @@
1
1
  module Capobvious
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capobvious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-05 00:00:00.000000000 Z
12
+ date: 2012-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano