cumuli 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99ef0de4fd4c50b58aaeb4ebe381eea7f06ebba6
4
- data.tar.gz: 90149d60a66ab52a9b0769e611706d673fea480d
3
+ metadata.gz: 42f2220f89f952c7401ffdc12925c578e4fe9faf
4
+ data.tar.gz: 93e24073b5c31ae06e4346688cd90d362efc4455
5
5
  SHA512:
6
- metadata.gz: 934f662727f2fa25fa6c64fe7f93572b237f1fcf4b141e9a249e4e81d2cedc18850d8a73a5f43572bfb0f12b08ada252d67c57f63dbe8d6ef69e4b10812b5a40
7
- data.tar.gz: b7305c29e3ae04e9cdcfc8201253dd72dcdd762b23ade163f3a48c57812ec927c50cc587644077bea517b941eb7a674fe737cf3e58a8b1fbc3fd45c741a69c06
6
+ metadata.gz: 81c947e7f4f98a13c0058aa68681bf500c8228134d89dc21891c2b2bc388f3fa4b4473df6ae37d288ee0befeac145953143f1295990088fdd7c495f85c31d01b
7
+ data.tar.gz: a692b04f8c00d32ae3b6de2abe6551d07f2fb22af043b545104490fee4465fda1c3c7bbe613ce6eccbe2c2c80749ec562a6220b23cd5a8cbd7d4e3083ac9d1c8
data/.gitignore CHANGED
@@ -19,3 +19,6 @@ tmp
19
19
  Procfile
20
20
  log/*.log
21
21
  spec/fixtures/log/*.log
22
+
23
+ config
24
+ Procfile
data/Rakefile CHANGED
@@ -6,3 +6,11 @@ require 'cucumber/rake/task'
6
6
  Cucumber::Rake::Task.new(:cucumber) do |t|
7
7
  t.cucumber_opts = "features --format pretty"
8
8
  end
9
+
10
+ desc 'run rspec'
11
+ task :spec do
12
+ system('rspec')
13
+ end
14
+
15
+ desc "run rspec and cucumber"
16
+ task :default => [:spec, :cucumber]
data/cumuli.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'cumuli/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "cumuli"
8
8
  spec.version = Cumuli::VERSION
9
- spec.authors = ["SocialChorus", "Kane Baccigalupi", "Fito von Zastrow", "Roy Pfaffman", "Sowjanya Mudunuri"]
9
+ spec.authors = ["SocialChorus", "Kane Baccigalupi", "Fito von Zastrow", "Roy Pfaffman", "Sowjanya Mudunuri", "Bonnie Kwong"]
10
10
  spec.email = ["developers@socialchorus.com"]
11
11
  spec.description = %q{Cumuli runs several foreman processes in different directories}
12
12
  spec.summary = %q{Cumuli makes SOA on Heroku easier by delegating to Foreman in a Procfile}
data/lib/cumuli.rb CHANGED
@@ -6,6 +6,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
  require 'logger'
7
7
  require 'timeout'
8
8
  require 'fileutils'
9
+ require 'yaml'
9
10
 
10
11
  require "cumuli/facade"
11
12
  require "cumuli/ps"
@@ -20,6 +20,7 @@ module Cumuli
20
20
  end
21
21
 
22
22
  def setup
23
+ publish
23
24
  submodules_init
24
25
  system('git submodule init')
25
26
  system('git submodule update')
@@ -6,7 +6,7 @@ module Cumuli
6
6
 
7
7
  attr_reader :name, :database_config, :database_sample_config, :port, :path,
8
8
  :repository, :type, :setup_scripts, :wait_time, :domain
9
-
9
+
10
10
  def initialize(name, opts)
11
11
  @name = name
12
12
 
@@ -50,12 +50,17 @@ module Cumuli
50
50
  "http://#{domain}#{port ? ":#{port}" : ''}"
51
51
  end
52
52
 
53
+ def full_path(partial_path)
54
+ partial_path.gsub!(/^\.\//, '')
55
+ "#{Dir.pwd}/#{partial_path}"
56
+ end
57
+
53
58
  def database_sample_paths
54
- database_sample_config.map { |config_path| "#{path}/#{config_path}" }
59
+ database_sample_config.map { |config_path| full_path("#{path}/#{config_path}") }
55
60
  end
56
61
 
57
62
  def database_config_paths
58
- database_config.map { |config_path| "#{path}/#{config_path}" }
63
+ database_config.map { |config_path| full_path("#{path}/#{config_path}") }
59
64
  end
60
65
 
61
66
  def database_configured?(path)
@@ -70,7 +75,7 @@ module Cumuli
70
75
 
71
76
  def write_database_config
72
77
  database_config_paths.each_with_index do |config_path, i|
73
- FileUtils.cp(database_sample_paths[i], config_path) unless configured?(config_path)
78
+ FileUtils.cp(database_sample_paths[i], config_path) unless database_configured?(config_path)
74
79
  end
75
80
  end
76
81
 
@@ -90,15 +95,21 @@ module Cumuli
90
95
  system "git submodule add #{repository} #{path}" if repository
91
96
  end
92
97
 
98
+ def run_command(command)
99
+ fork do
100
+ CLI::RemoteCommand.new([command, "DIR=#{path}"]).perform
101
+ end
102
+ end
103
+
93
104
  def setup
94
105
  # checkout master, because sometimes on setup no branch is
95
106
  # checked out
96
- CLI::RemoteCommand.new(['git checkout master', "DIR=#{path}"])
107
+ run_command 'git checkout master'
97
108
 
98
109
  write_database_config
99
110
 
100
111
  setup_scripts.each do |script|
101
- CLI::RemoteCommand.new([script, "DIR=#{path}"]).perform
112
+ run_command script
102
113
  end
103
114
  end
104
115
  end
@@ -11,6 +11,11 @@ namespace :cumuli do
11
11
  task :config do
12
12
  Cumuli::ProjectManager::Manager.new.setup_projects
13
13
  end
14
+
15
+ desc "publish Procfile from projects.yml"
16
+ task :publish do
17
+ Cumuli::ProjectManager::Manager.new.publish
18
+ end
14
19
  end
15
20
 
16
21
  namespace :ps do
@@ -29,7 +34,7 @@ namespace :cumuli do
29
34
  end
30
35
 
31
36
  desc "kill the root process"
32
- task :kill => ['cumuli:kill:root']
37
+ task :kill => ['cumuli:ps:kill:root']
33
38
 
34
39
  namespace :int do
35
40
  desc "interrupt all foreman related processes"
@@ -46,7 +51,7 @@ namespace :cumuli do
46
51
  end
47
52
 
48
53
  desc "interrupt the root process"
49
- task :int => ['cumuli:int:root']
54
+ task :int => ['cumuli:ps:int:root']
50
55
  end
51
56
 
52
57
  desc "look at the list of foreman related processes"
@@ -1,3 +1,3 @@
1
1
  module Cumuli
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cumuli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SocialChorus
@@ -9,6 +9,7 @@ authors:
9
9
  - Fito von Zastrow
10
10
  - Roy Pfaffman
11
11
  - Sowjanya Mudunuri
12
+ - Bonnie Kwong
12
13
  autorequire:
13
14
  bindir: bin
14
15
  cert_chain: []