This repository was archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 248
Generating Ruby SDK
mozehgir edited this page Nov 17, 2017
·
1 revision
- Install AutoRest
- Call autorest with the following arguments:
- If you have a readme.md file associated with the specification(s) you’re generating an SDK for:
autorest path --ruby --azure-arm --output-folder --package-version --package-name --namespace
Where these placeholders are replaced by the following:
path = path to the readme file
output-folder = path to where you want the generated code
package-version = gem version
package-name = name of the package ex. azure_mgmt_compute
namespace = namespace for your service ex. Azure::Compute::Mgmt::V2017_03_30
If you need to generate code for a specific tag from the readme.md file, you can also pass:
--tag (name of the tag to use)
- If you’re looking to generate code based on a specific swagger file, you can replace path ro readme file with the path to the swagger file
path = --input-file (path to the swagger file)
- Our current configuration values for each of the parameters are here.
- For more info on AutoRest command line.
- When an update is made to a spec in azure-rest-api-specs repo, that’s already getting picked up by the Ruby SDK via:
https://github.com/Azure/azure-sdk-for-ruby/blob/master/swagger_to_sdk_config.json
A PR will get automatically created in azure-sdk-for-ruby repo with the corresponding changes. - Feel free to comment on the PR
- The Ruby SDK will pick it up from here, if you need to merge the change as soon as possible, please comment on the PR and/or send email to Azure DevEx Ruby team.
Currently done by the Ruby SDK team. Send an email to Azure DevX Ruby team to request a new gem in the Ruby SDK.
Service teams can also do the process themselves if they choose to do so by following the instructions below:
- Create a PR against azure-sdk-for-ruby repo containing:
- Folder for the new gem with the name of the package as the folder name:
- You can copy&paste an existing folder like
https://github.com/Azure/azure-sdk-for-ruby/tree/master/management/azure_mgmt_compute
- You can copy&paste an existing folder like
- Include .gemspec file, Rakefile, License.txt, .rspec, README.md, spec folder (with spec_helper.rb boiler plate code or tests), lib folder
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/config.json with the necessary configuration for the new service
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/swagger_to_sdk_config.json with the necessary configuration for the new service
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/GEM_VERSIONS
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/GEMS_TO_RELEASE if it’s expected to be released.
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/profile_specs/profiles.json
- Under “rollup” section: to have the new gem included in the “Lastest” azure_sdk roll-up gem.
- Under “management” section: to have a profile created for the gem which includes the necessary API versions.
- To generate the SDK Run “rake arm:regen” – Note: the current rake tasks generate the full SDK with all services, if you want to generate just yours, comment out all except the one you added in config.json. Please have a separate commit with the generated code, as including all changes in 1 commit makes it hard to review.
- Use rake arm:build task to build gems for everything in:
https://github.com/Azure/azure-sdk-for-ruby/blob/master/swagger_to_sdk_config.json
Or - Run rake build from your gems folder to build that individual gem.
Please email Azure DevEx Ruby team to kick off a release.