bard 0.24.6 → 0.25.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bard.rb +29 -19
  3. data/lib/bard/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5844f566ca8e0fd65e0b9cf639c301fa36c8116d
4
- data.tar.gz: 8b2769cd7973874b7c33033b17a4f5a29cc75d04
3
+ metadata.gz: 59f134a4a6630cf0e2f30204330e397e65a5aa98
4
+ data.tar.gz: b77f661ce53aad8e9434cff7965b5ac647c2d504
5
5
  SHA512:
6
- metadata.gz: 1671f994d2f8a5ba455b858bb44e7bd65b9465d5c659c8c9a44d0ae20b64e90a1b9bc61e7cb5c03b0f8e3e7a6b534063229ac807fb9415ec455366137d807120
7
- data.tar.gz: 252b444819b9cb9d73b197f25fb5b0c42cfa20da2ac92d353cb2086bc849a3f592a6a725132ff52d60dec304decb526daa560fd031b402e7924ee10bdb4c5859
6
+ metadata.gz: 33a0c836a8bdebb3f8e37f64839aa74ab017d6d33ead1bb342fbb58590cadfd708546227079c7ae89f4210ecab02150a6f0115ae3cd31cd00c669298317cbe59
7
+ data.tar.gz: 586166dd5ad5f1e0748f7d42198fa7e3d2ef4919299e7f97466e653ae1e0722421abe532ab300adc762ef3f0a9148997fd0108c31620faffa26a94edde161a5a
@@ -33,7 +33,7 @@ class Bard::CLI < Thor
33
33
  puts green("Stage Succeeded")
34
34
  end
35
35
 
36
- method_options %w( verbose -v ) => :boolean
36
+ method_options %w( verbose -v ) => :boolean, %w( force ) => :boolean
37
37
  desc "deploy", "checks that branch is a ff with master, checks with ci, and then merges into master and deploys to production, and deletes branch."
38
38
  def deploy
39
39
  branch = Git.current_branch
@@ -81,29 +81,39 @@ class Bard::CLI < Thor
81
81
  desc "ci", "runs ci against current HEAD"
82
82
  def ci
83
83
  ci = CI.new(project_name, Git.current_sha)
84
- return unless ci.exists?
85
- puts "Continuous integration: starting build on #{Git.current_branch}..."
84
+ if ci.exists?
85
+ puts "Continuous integration: starting build on #{Git.current_branch}..."
86
+
87
+ success = ci.run do |elapsed_time, last_time|
88
+ if last_time
89
+ percentage = (elapsed_time.to_f / last_time.to_f * 100).to_i
90
+ output = " Estimated completion: #{percentage}%"
91
+ else
92
+ output = " No estimated completion time. Elapsed time: #{elapsed_time} sec"
93
+ end
94
+ print "\x08" * output.length
95
+ print output
96
+ $stdout.flush
97
+ end
86
98
 
87
- success = ci.run do |elapsed_time, last_time|
88
- if last_time
89
- percentage = (elapsed_time.to_f / last_time.to_f * 100).to_i
90
- output = " Estimated completion: #{percentage}%"
99
+ if success
100
+ puts
101
+ puts "Continuous integration: success! deploying to production"
91
102
  else
92
- output = " No estimated completion time. Elapsed time: #{elapsed_time} sec"
103
+ puts
104
+ puts ci.console
105
+ puts red("Automated tests failed!")
106
+ exit 1
93
107
  end
94
- print "\x08" * output.length
95
- print output
96
- $stdout.flush
97
- end
98
108
 
99
- if success
100
- puts
101
- puts "Continuous integration: success! deploying to production"
102
109
  else
103
- puts
104
- puts ci.console
105
- puts "Automated tests failed!"
106
- exit 1
110
+ puts red("No CI found for #{project_name}!")
111
+ if options.force?
112
+ puts "Forcing deploy, anyways. I hope you know what you're doing!"
113
+ else
114
+ puts "Re-run with --force to bypass CI, if you absolutely must, and know what you're doing."
115
+ exit 1
116
+ end
107
117
  end
108
118
  end
109
119
 
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.24.6"
2
+ VERSION = "0.25.0"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.6
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor