codebuild-tail 0.1.0 → 0.2.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/code_build_tail/logs.rb +11 -2
- data/lib/code_build_tail/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: da04bdc77c07bbc68c2a49958cf44640453990f9
|
4
|
+
data.tar.gz: 884e99f69423c313e47eae18f51f064b8d5d67c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8813f43fe0f1cfb279252f8db84e2f78b5b46d16d51bf8f8a60a712a86ec184b879a6fe2f85984b0162d9a312ad5ade1b8c72fa4a7c38eb1155d7e9d9f61471a
|
7
|
+
data.tar.gz: 6232f1869a6dcdccbf2b0f3c5d3ee31d8b926325c0604a8ce6c330259c81c9dcb0819f828641b93515d2f12b15c990f2a40e5cb13906921cfabac8a67b3cead6
|
data/lib/code_build_tail/logs.rb
CHANGED
@@ -1,14 +1,23 @@
|
|
1
1
|
|
2
2
|
module CodeBuildTail
|
3
3
|
class Logs
|
4
|
-
def initialize(
|
4
|
+
def initialize(cloudwatch_client, poll_from_start, log_limit)
|
5
5
|
@log_limit = log_limit
|
6
6
|
@next_forward_token = nil
|
7
7
|
@poll_from_start = poll_from_start
|
8
|
-
@cloudwatch_client =
|
8
|
+
@cloudwatch_client = cloudwatch_client
|
9
9
|
end
|
10
10
|
|
11
11
|
def get_latest_logs(group_name, stream_name)
|
12
|
+
# Sometimes when a CodeBuild job is first started it doesn't yet
|
13
|
+
# have a CloudWatch group and/or stream name associated with it.
|
14
|
+
# In this case, the keys for these values will be missing from
|
15
|
+
# the returned hash so they show up in this function as nil. We
|
16
|
+
# can simply return an empty list in this case because the app
|
17
|
+
# logic will then update the state of the build which will cause
|
18
|
+
# this function to work on subsquent attempts.
|
19
|
+
return [] if group_name.nil? || stream_name.nil?
|
20
|
+
|
12
21
|
params = {
|
13
22
|
log_group_name: group_name,
|
14
23
|
log_stream_name: stream_name,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebuild-tail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Roddy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|