cody 0.8.0 → 0.8.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/cody/tailer.rb +20 -0
- data/lib/cody/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f1f0a386b9a31e991c4780b802ad8db436b1a7fc0a620eae0be450b44ea35bb
|
4
|
+
data.tar.gz: b22ac1a609aca0baebe683b51818253b7eae58512e9bbd0c6f9c4019ab94d800
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bab07629f7f5762273e3a0c199514ef5cab34edd7350e725c26c1d55c8a25d92d2e5515ea5074b497c6272cde07861741586dd28951b71856a8cd5b07163d0c1
|
7
|
+
data.tar.gz: 3e14ba65fcb5ab8d2abfe0cef22b370725cf65b779cbeacfa080f5e4a1bca526072f30b9b9993ebf8162f7a61b5315e00625099940a4192c69533c2c5220e594
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.8.1]
|
7
|
+
- #8 report build time at end of logs
|
8
|
+
|
6
9
|
## [0.8.0]
|
7
10
|
- #7 add cody logs command and automatically tail logs after a cody start
|
8
11
|
|
data/lib/cody/tailer.rb
CHANGED
@@ -20,6 +20,7 @@ module Cody
|
|
20
20
|
|
21
21
|
def run
|
22
22
|
puts "Showing logs for build #{@build_id}"
|
23
|
+
|
23
24
|
complete = false
|
24
25
|
until complete do
|
25
26
|
build = find_build
|
@@ -34,8 +35,11 @@ module Cody
|
|
34
35
|
start_cloudwatch_tail unless ENV["CODY_TEST"]
|
35
36
|
sleep 5 if !@@end_loop_signal && !complete && !ENV["CODY_TEST"]
|
36
37
|
end
|
38
|
+
|
37
39
|
AwsLogs::Tail.stop_follow!
|
38
40
|
@thread.join if @thread
|
41
|
+
|
42
|
+
puts "The build took #{build_time(build)} to complete."
|
39
43
|
end
|
40
44
|
|
41
45
|
def start_cloudwatch_tail
|
@@ -115,5 +119,21 @@ module Cody
|
|
115
119
|
exit # immediate exit
|
116
120
|
}
|
117
121
|
end
|
122
|
+
|
123
|
+
def build_time(build)
|
124
|
+
duration = build.phases.inject(0) { |sum,p| sum + p.duration_in_seconds.to_i }
|
125
|
+
pretty_time(duration)
|
126
|
+
end
|
127
|
+
|
128
|
+
# http://stackoverflow.com/questions/4175733/convert-duration-to-hoursminutesseconds-or-similar-in-rails-3-or-ruby
|
129
|
+
def pretty_time(total_seconds)
|
130
|
+
minutes = (total_seconds / 60) % 60
|
131
|
+
seconds = total_seconds % 60
|
132
|
+
if total_seconds < 60
|
133
|
+
"#{seconds.to_i}s"
|
134
|
+
else
|
135
|
+
"#{minutes.to_i}m #{seconds.to_i}s"
|
136
|
+
end
|
137
|
+
end
|
118
138
|
end
|
119
139
|
end
|
data/lib/cody/version.rb
CHANGED