mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
clients: fix API builder (#290)
This commit is contained in:
@@ -19,8 +19,7 @@ gem install http
|
||||
Everytime the API spec is updated, be sure to bump the version number in `swagger.yml`, then run:
|
||||
|
||||
```sh
|
||||
# The GITHUB_TOKEN, GITHUB_USERNAME and GIST_ID requirement is temporary, just used to automate the gist. Once this is public, we don't need the gist anymore.
|
||||
GITHUB_TOKEN=X GITHUB_USERNAME=treeder GIST_ID=Y ruby build.rb
|
||||
ruby build.rb
|
||||
```
|
||||
|
||||
Boom. That's it.
|
||||
|
||||
@@ -6,20 +6,7 @@ require 'openssl'
|
||||
|
||||
require_relative '../tests/utils.rb'
|
||||
|
||||
gist_id = ENV['GIST_ID']
|
||||
gist_url = "https://api.github.com/gists/#{gist_id}"
|
||||
puts gist_url
|
||||
HTTP.auth("Token #{ENV['GITHUB_TOKEN']}")
|
||||
.patch(gist_url, :json => {
|
||||
"files"=> {
|
||||
"swagger.yml" => {
|
||||
"content" => File.read('../docs/swagger.yml')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
swaggerUrl = "https://gist.githubusercontent.com/#{ENV['GITHUB_USERNAME']}/#{gist_id}/raw/"
|
||||
# swaggerRaw = open(swaggerUrl){|f| f.read}
|
||||
swaggerUrl = "https://raw.githubusercontent.com/iron-io/functions/master/docs/swagger.yml"
|
||||
spec = YAML.load(open(swaggerUrl))
|
||||
version = spec['info']['version']
|
||||
puts "VERSION: #{version}"
|
||||
|
||||
Reference in New Issue
Block a user