jenkins_shell 0.0.3 → 0.0.4
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/bin/jsh +6 -0
- data/lib/jenkins_shell.rb +12 -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: 312770d8559331c1c1c690d8d951379fba91f3a4e9485c6943924dcc4e1ae66d
|
4
|
+
data.tar.gz: ec496b9f0adae39a2f5957f6a4e22679fef0ae7ce0e8ae6bac57ea83dc6ae218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cde7c76edd18478d4d3160106d86a8daa15e5e492784e0ff1743fe82cee190086f2b13866fedcb9e5558f7a072bc5f9c681f8d030475be4220b5fc0612219343
|
7
|
+
data.tar.gz: 9ce975b9adc01fe55d8c2bc67d6cb69061404935cbd50868f6d911628137f74fdf1043115a4f01f2d2264b052565ec4a82ed5cdfe1fe98a434391ca0d5c503be
|
data/bin/jsh
CHANGED
@@ -27,6 +27,7 @@ def parse(args)
|
|
27
27
|
options = Hash.new
|
28
28
|
options["password"] = nil
|
29
29
|
options["port"] = "8080"
|
30
|
+
options["ssl"] = false
|
30
31
|
options["username"] = nil
|
31
32
|
options["verbose"] = false
|
32
33
|
|
@@ -69,6 +70,10 @@ def parse(args)
|
|
69
70
|
options["port"] = port
|
70
71
|
end
|
71
72
|
|
73
|
+
opts.on("-s", "--ssl", "Use TLS/SSL") do
|
74
|
+
options["ssl"] = true
|
75
|
+
end
|
76
|
+
|
72
77
|
opts.on("-u", "--user=USER", "Use specified username") do |u|
|
73
78
|
options["username"] = u
|
74
79
|
end
|
@@ -123,6 +128,7 @@ begin
|
|
123
128
|
jsh = JenkinsShell.new(
|
124
129
|
options["host"],
|
125
130
|
options["port"],
|
131
|
+
options["ssl"],
|
126
132
|
options["username"],
|
127
133
|
passwd
|
128
134
|
)
|
data/lib/jenkins_shell.rb
CHANGED
@@ -51,6 +51,7 @@ class JenkinsShell
|
|
51
51
|
begin
|
52
52
|
# Establish connection
|
53
53
|
http = Net::HTTP.new(@host, @port)
|
54
|
+
http.use_ssl = @ssl
|
54
55
|
|
55
56
|
# Create request
|
56
57
|
req = Net::HTTP::Get.new(path)
|
@@ -78,14 +79,23 @@ class JenkinsShell
|
|
78
79
|
end
|
79
80
|
private :get
|
80
81
|
|
81
|
-
def initialize(
|
82
|
+
def initialize(
|
83
|
+
host,
|
84
|
+
port = 8080,
|
85
|
+
ssl = false,
|
86
|
+
username = nil,
|
87
|
+
password = nil
|
88
|
+
)
|
82
89
|
@cookie = nil
|
83
90
|
@crumb = nil
|
84
91
|
@int_cwd = "."
|
85
92
|
@host = host.gsub(/^https?:\/\/|(:[0-9]+)?\/.+/, "")
|
86
93
|
@password = password
|
87
94
|
@port = port
|
95
|
+
@ssl = ssl
|
88
96
|
@username = username
|
97
|
+
|
98
|
+
# Initialize @cwd
|
89
99
|
@cwd = pwd
|
90
100
|
end
|
91
101
|
|
@@ -110,6 +120,7 @@ class JenkinsShell
|
|
110
120
|
begin
|
111
121
|
# Establish connection
|
112
122
|
http = Net::HTTP.new(@host, @port)
|
123
|
+
http.use_ssl = @ssl
|
113
124
|
|
114
125
|
# Create request
|
115
126
|
req = Net::HTTP::Post.new(path)
|