chap 0.1.0 → 0.1.1

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.
@@ -18,6 +18,7 @@ module Chap
18
18
  Deploys code using settings from chap.json and node.json. chap.json and node.json should be referenced in chap.yml.
19
19
  EOL
20
20
  method_option :quiet, :aliases => '-q', :type => :boolean, :desc => "Quiet commands"
21
+ method_option :silence, :aliases => '-s', :type => :boolean, :desc => "Complete silence"
21
22
  method_option :config, :aliases => '-c', :default => '/etc/chef/chap.yml', :desc => "chap.yml config to use"
22
23
  method_option :stop_at_symlink, :type => :boolean, :desc => "Deploy code but stop right before the symlink"
23
24
  method_option :cont_at_symlink, :type => :boolean, :desc => "Symlink and contine the deploy"
@@ -10,9 +10,11 @@ module Chap
10
10
  end
11
11
 
12
12
  def deploy
13
+ puts "Deploy started" unless options[:silence]
13
14
  deploy_to_symlink
14
15
  deploy_from_symlink
15
16
  report_benchmarks
17
+ puts "Deploy finished" unless options[:silence]
16
18
  end
17
19
 
18
20
  def deploy_to_symlink
@@ -1,3 +1,3 @@
1
1
  module Chap
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -12,6 +12,7 @@ describe Chap do
12
12
  describe "internal code deploy" do
13
13
  before(:each) do
14
14
  @chap = Chap::Runner.new(
15
+ :silence => true,
15
16
  :quiet => true,
16
17
  :config => "#{system_root}/etc/chef/chap.yml"
17
18
  )
@@ -31,7 +32,7 @@ describe Chap do
31
32
 
32
33
  describe "cli deploy" do
33
34
  it "should deploy code via command line" do
34
- system("cd #{root} && ./bin/chap deploy -q -c #{system_root}/etc/chef/chap.yml")
35
+ system("cd #{root} && ./bin/chap deploy -s -q -c #{system_root}/etc/chef/chap.yml")
35
36
  releases = Dir.glob("#{system_root}/data/chapdemo/releases/*").sort
36
37
  timestamp = releases.last.split('/').last
37
38
  release_path = "#{system_root}/data/chapdemo/releases/#{timestamp}"
@@ -44,7 +45,7 @@ describe Chap do
44
45
  end
45
46
 
46
47
  it "should deploy code and test hook" do
47
- system("cd #{root} && ./bin/chap deploy -q -c #{system_root}/etc/chef/chap.yml")
48
+ system("cd #{root} && ./bin/chap deploy -s -q -c #{system_root}/etc/chef/chap.yml")
48
49
  releases = Dir.glob("#{system_root}/data/chapdemo/releases/*").sort
49
50
  timestamp = releases.last.split('/').last
50
51
  release_path = "#{system_root}/data/chapdemo/releases/#{timestamp}"
@@ -65,7 +66,7 @@ describe Chap do
65
66
  end
66
67
 
67
68
  it "should deploy code stopping and continuing at symlink" do
68
- system("cd #{root} && ./bin/chap deploy --stop-at-symlink -q -c #{system_root}/etc/chef/chap.yml")
69
+ system("cd #{root} && ./bin/chap deploy --stop-at-symlink -s -q -c #{system_root}/etc/chef/chap.yml")
69
70
  releases = Dir.glob("#{system_root}/data/chapdemo/releases/*").sort
70
71
  timestamp = releases.last.split('/').last
71
72
  release_path = "#{system_root}/data/chapdemo/releases/#{timestamp}"
@@ -77,7 +78,7 @@ describe Chap do
77
78
  releases.should == 1
78
79
  sleep 2 if tier(2)
79
80
  # continue deploy
80
- system("cd #{root} && ./bin/chap deploy --cont-at-symlink -q -c #{system_root}/etc/chef/chap.yml")
81
+ system("cd #{root} && ./bin/chap deploy --cont-at-symlink -s -q -c #{system_root}/etc/chef/chap.yml")
81
82
  link = File.readlink(current_path)
82
83
  link.should == release_path
83
84
  end
@@ -102,9 +103,9 @@ describe Chap do
102
103
  end
103
104
 
104
105
  it "should only respect keep option" do
105
- system("cd #{root} && ./bin/chap deploy -q -c #{system_root}/etc/chef/chap.yml")
106
+ system("cd #{root} && ./bin/chap deploy -s -q -c #{system_root}/etc/chef/chap.yml")
106
107
  sleep 1
107
- system("cd #{root} && ./bin/chap deploy -q -c #{system_root}/etc/chef/chap.yml")
108
+ system("cd #{root} && ./bin/chap deploy -s -q -c #{system_root}/etc/chef/chap.yml")
108
109
  releases = Dir.glob("#{system_root}/data/chapdemo/releases/*").size
109
110
  releases.should == 2 # test the keep option
110
111
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: