File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,26 @@ namespace :docs do
44
44
puts "Finished generating #{ entries . length } files in #{ Time . now . to_i - start_time } seconds"
45
45
end
46
46
47
+ desc 'Update report'
48
+ task :update do
49
+ require 'elastic-transport'
50
+ github_token = File . read ( File . expand_path ( "~/.elastic/github.token" ) )
51
+ transport_options = {
52
+ headers : {
53
+ Accept : 'application/vnd.github.v3.raw' ,
54
+ Authorization : "token #{ github_token } "
55
+ }
56
+ }
57
+ client = Elastic ::Transport ::Client . new (
58
+ host : 'https://api.github.com/' ,
59
+ transport_options :transport_options
60
+ )
61
+ path = '/repos/elastic/clients-flight-recorder/contents/recordings/docs/parsed-alternative-report.json'
62
+ params = { }
63
+ response = client . perform_request ( 'GET' , path , params )
64
+ File . write ( File . expand_path ( './docs/parsed_alternative_report.json' , __dir__ ) , response . body )
65
+ end
66
+
47
67
def json_data
48
68
JSON . parse ( File . read ( SRC_FILE ) )
49
69
end
You can’t perform that action at this time.
0 commit comments