clients: fix API builder (#290)

This commit is contained in:
C Cirello
2016-11-15 15:49:20 +01:00
committed by Travis Reeder
parent 299422cf7d
commit c3ffe2ed29
2 changed files with 8 additions and 22 deletions

View File

@@ -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.

View File

@@ -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}"