File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ module Benchmarker =
167
167
if indexResponse.IsValid = false then
168
168
raise ( Exception( " Unable to index report into Elasticsearch: " + indexResponse.ServerError.Error.ToString()))
169
169
170
- let IndexResults url =
170
+ let IndexResults ( url , username , password ) =
171
171
if ( String.IsNullOrEmpty url = false ) then
172
172
trace " Indexing benchmark results into Elasticsearch"
173
173
@@ -179,7 +179,12 @@ module Benchmarker =
179
179
|> Seq.toList
180
180
181
181
let uri = new Uri( url)
182
- let client = new ElasticClient( uri)
182
+ let connectionSettings = new ConnectionSettings( uri);
183
+
184
+ if ( String.IsNullOrEmpty username = false && String.IsNullOrEmpty password = false ) then
185
+ connectionSettings.BasicAuthentication( username, password) |> ignore
186
+
187
+ let client = new ElasticClient( connectionSettings)
183
188
184
189
let indexExists = client.IndexExists( Indices.op_ Implicit( indexName)) .Exists
185
190
Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ module Commandline =
77
77
78
78
| [ " test" ; testFilter] -> setBuildParam " testfilter" testFilter
79
79
80
+ | [ " benchmark" ; IsUrl elasticsearch; username; password] ->
81
+ setBuildParam " elasticsearch" elasticsearch
82
+ setBuildParam " nonInteractive" " 0"
83
+ setBuildParam " username" username
84
+ setBuildParam " password" password
85
+
80
86
| [ " benchmark" ; IsUrl elasticsearch] ->
81
87
setBuildParam " elasticsearch" elasticsearch
82
88
setBuildParam " nonInteractive" " 0"
Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ Target "Benchmark" <| fun _ ->
52
52
let runInteractive = (( getBuildParam " nonInteractive" ) <> " 1" )
53
53
Benchmarker.Run( runInteractive)
54
54
let url = getBuildParam " elasticsearch"
55
- Benchmarker.IndexResults url
55
+ let username = getBuildParam " username"
56
+ let password = getBuildParam " password"
57
+ Benchmarker.IndexResults ( url, username, password)
56
58
57
59
Target " InheritDoc" InheritDoc.PatchInheritDocs
58
60
You can’t perform that action at this time.
0 commit comments