clc-promote 0.8.0 → 0.8.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: 51ac1711f235f79d4b72524866f866a3102fe775
4
- data.tar.gz: 1b58e49d41e138be59c1740bead020ae83cdd8f5
3
+ metadata.gz: c9170560e1bf8c16a5798bd773d9cc4bfef23516
4
+ data.tar.gz: 01b3e175efef8c94b18641cf7c0013970cef6464
5
5
  SHA512:
6
- metadata.gz: 63359bcc4e3bb5347c9ecf0476bed57784b1da22c92a80bca824d66987cd127148ffcc917357989c105e2b3cac9666bea564f5257349486817f02c6d9df59879
7
- data.tar.gz: 80827f613f6d462f7421ca8eb4e8520c9ff66c1a6fedd8389178b192b504b472cbd717730361c2057beaaf8235e029eb00eff0644bcd1f9703b4db7c7a861be3
6
+ metadata.gz: 9a7153de0b612ad26dc19c73f358bb96eb30c669fa0a20c66e573194d74463828320f3420c48d6ea880c6b938ddb2f40e7e120e128157f4afa338133f8cce941
7
+ data.tar.gz: d8817ff31d88a6cd20118d746132023c4f18b954afbacca5b8d9267d5bd832f645e89b6054f36f56e54552b4c3a1b6a16831c7f233498d0a8ceacdcac3fff837
@@ -20,14 +20,14 @@ module Promote
20
20
  dest.write_cookbook_versions(source.cookbook_versions)
21
21
  end
22
22
 
23
- def monitor_promotion(source_environment, destination_environments, probe_interval, max_wait = 3600, ui = nil)
23
+ def monitor_promotion(source_environment, destination_environments, probe_interval, force = false, max_wait = 3600, ui = nil)
24
24
  ui.info "Waiting for #{source_environment} to finish" if ui
25
25
  check_promotion(source_environment, probe_interval, max_wait, ui)
26
26
 
27
27
  uploader = Uploader.new(config)
28
28
 
29
29
  destination_environments.each do |env|
30
- ui.confirm "Promote #{source_environment} to #{env}" if ui
30
+ ui.confirm "Promote #{source_environment} to #{env}" if ui && !force
31
31
  promote_to(source_environment, env, ui)
32
32
  uploader.upload_environment(env, ui)
33
33
 
@@ -109,10 +109,10 @@ module Promote
109
109
  def define_promote_environments
110
110
  namespace "Promote" do
111
111
  desc "Promote a list of environments from another"
112
- task "promote_environments", :source_environment, :destination_environments do |task, args|
112
+ task "promote_environments", :source_environment, :destination_environments, :force do |task, args|
113
113
  puts "Promoting constraints in #{args.source_environment} to #{args.destination_environments}"
114
114
  ui = Chef::Knife::UI.new(STDOUT, STDERR, STDIN, {})
115
- @promoter.monitor_promotion(args.source_environment, args.destination_environments.split(' '), 5, 3600, ui)
115
+ @promoter.monitor_promotion(args.source_environment, args.destination_environments.split(' '), 5, args.force, 3600, ui)
116
116
  end
117
117
  end
118
118
  end
@@ -1,3 +1,3 @@
1
1
  module Promote
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
@@ -89,7 +89,7 @@ describe Promote::Promoter do
89
89
  expect(subject).to receive(:promote_to).with("env1", env, ui)
90
90
  expect(uploader).to receive(:upload_environment).with(env, ui)
91
91
  end
92
- subject.monitor_promotion("env1", ["env2", "env3", "env4"], 0.25, 1, ui)
92
+ subject.monitor_promotion("env1", ["env2", "env3", "env4"], 0.25, false, 1, ui)
93
93
  end
94
94
  end
95
95
 
@@ -102,7 +102,7 @@ describe Promote::Promoter do
102
102
  expect(subject).not_to receive(:promote_to)
103
103
  expect(uploader).not_to receive(:upload_environment)
104
104
 
105
- expect{ subject.monitor_promotion("env1", ["env2", "env3", "env4"], 0.25, 1, ui) }.to raise_error(/env1$/)
105
+ expect{ subject.monitor_promotion("env1", ["env2", "env3", "env4"], 0.25, false, 1, ui) }.to raise_error(/env1$/)
106
106
  end
107
107
  end
108
108
 
@@ -118,7 +118,7 @@ describe Promote::Promoter do
118
118
  end
119
119
  expect(subject).not_to receive(:promote_to).with("env1", "env4", ui)
120
120
  expect(uploader).not_to receive(:upload_environment).with("env4")
121
- expect{ subject.monitor_promotion("env1", ["env2", "env3", "env4"], 0.25, 1, ui) }.to raise_error(/env3$/)
121
+ expect{ subject.monitor_promotion("env1", ["env2", "env3", "env4"], 0.25, false, 1, ui) }.to raise_error(/env3$/)
122
122
  end
123
123
  end
124
124
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clc-promote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CenturyLink Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-24 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clc-git