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.
- checksums.yaml +4 -4
- data/lib/bard.rb +29 -19
- data/lib/bard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59f134a4a6630cf0e2f30204330e397e65a5aa98
|
4
|
+
data.tar.gz: b77f661ce53aad8e9434cff7965b5ac647c2d504
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33a0c836a8bdebb3f8e37f64839aa74ab017d6d33ead1bb342fbb58590cadfd708546227079c7ae89f4210ecab02150a6f0115ae3cd31cd00c669298317cbe59
|
7
|
+
data.tar.gz: 586166dd5ad5f1e0748f7d42198fa7e3d2ef4919299e7f97466e653ae1e0722421abe532ab300adc762ef3f0a9148997fd0108c31620faffa26a94edde161a5a
|
data/lib/bard.rb
CHANGED
@@ -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
|
-
|
85
|
-
|
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
|
-
|
88
|
-
|
89
|
-
|
90
|
-
output = " Estimated completion: #{percentage}%"
|
99
|
+
if success
|
100
|
+
puts
|
101
|
+
puts "Continuous integration: success! deploying to production"
|
91
102
|
else
|
92
|
-
|
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
|
-
|
105
|
-
|
106
|
-
|
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
|
|
data/lib/bard/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|