drone-builds 0.4.0 → 0.4.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/README.md +1 -1
- data/lib/drone/builds/cli.rb +15 -3
- data/lib/drone/builds/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33a31b2db150a273934fa819396b448055148919
|
4
|
+
data.tar.gz: 2a00a1bc6cb3edebd752d31953baafa9acf95520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0438e050c256900f21d27381f30670161633957e6233c2ed6766fbc81117f867598764483890943be8224c7855a17507dbe94699f3257e4385816f429a096607'
|
7
|
+
data.tar.gz: adc824f5103de6e31e0f81a01d1fd77cd7c6f0c55ae8552f0ce0f620afdcfe940d4dbf8fa84e5abf8aca82359722b9d4cfbac0305c81a6eaba8ac24ffae817b0
|
data/README.md
CHANGED
data/lib/drone/builds/cli.rb
CHANGED
@@ -33,7 +33,9 @@ class Drone::Builds::Cli < Thor
|
|
33
33
|
def show(id = nil)
|
34
34
|
ref = self.class.options_to_ref(options)
|
35
35
|
|
36
|
-
|
36
|
+
if id.to_i.to_s != id
|
37
|
+
id = self.class.client.list(limit: options[:last]&.abs, ref: ref)[0]&.[]('id')
|
38
|
+
end
|
37
39
|
|
38
40
|
abort "No build found for options: #{options}" unless id
|
39
41
|
|
@@ -54,13 +56,23 @@ class Drone::Builds::Cli < Thor
|
|
54
56
|
end
|
55
57
|
|
56
58
|
def self.client
|
59
|
+
server = HOME_ENV[:DRONE_SERVER]
|
60
|
+
domain = HOME_ENV[:DRONE_DOMAIN]
|
61
|
+
|
62
|
+
abort("You can't specify both DRONE_SERVER and DRONE_DOMAIN") if server && domain
|
63
|
+
|
64
|
+
if server
|
65
|
+
protocol, domain = server.split("://")
|
66
|
+
end
|
67
|
+
|
57
68
|
@client ||=
|
58
69
|
Drone::Builds.new(
|
70
|
+
protocol: protocol,
|
71
|
+
domain: domain,
|
59
72
|
token: HOME_ENV[:DRONE_TOKEN],
|
60
|
-
domain: HOME_ENV[:DRONE_DOMAIN],
|
61
73
|
owner: HOME_ENV[:DRONE_OWNER],
|
62
74
|
name: HOME_ENV[:DRONE_NAME],
|
63
|
-
job_id: HOME_ENV[:DRONE_JOB_ID]
|
75
|
+
job_id: HOME_ENV[:DRONE_JOB_ID],
|
64
76
|
)
|
65
77
|
end
|
66
78
|
|
data/lib/drone/builds/version.rb
CHANGED