File tree Expand file tree Collapse file tree 6 files changed +86
-25015
lines changed
Expand file tree Collapse file tree 6 files changed +86
-25015
lines changed Original file line number Diff line number Diff line change 1+ name : Update gem from OpenAPI Spec
2+
3+ on :
4+ workflow_dispatch :
5+ schedule :
6+ - cron : ' 0 0 * * 0'
7+
8+ jobs :
9+ openapi-generate :
10+ runs-on : ubuntu-latest
11+ env :
12+ INPUT_SPEC_VERSION : v4.0
13+ steps :
14+ - uses : actions/checkout@v5
15+ - name : Set up system
16+ run : sudo apt install -y xq
17+ - name : OpenAPI Generate
18+ run : bin/openapi-generate
19+ - name : Create Pull Request
20+ uses : peter-evans/create-pull-request@v7
21+ with :
22+ add-paths : |
23+ .openapi-generator
24+ docs
25+ lib
26+ README.md
27+ spec
28+ commit-message : Update nutanix_clustermgmt gem
29+ branch : openapi_generate
30+ author : ManageIQ Bot <bot@manageiq.org>
31+ committer : ManageIQ Bot <bot@manageiq.org>
32+ delete-branch : true
33+ labels : enhancement
34+ assignees : agrare
35+ push-to-fork : miq-bot/nutanix_clustermgmt-sdk-ruby
36+ title : Update nutanix_clustermgmt gem
37+ body : Update the nutanix_clustermgmt-sdk-ruby gem from the nutanix_clustermgmt openapi-spec https://developers.nutanix.com/api/v1/namespaces/clustermgmt/versions/${{ env.INPUT_SPEC_VERSION }}/yaml
38+ token : ${{ secrets.PR_TOKEN }}
Original file line number Diff line number Diff line change 3737
3838# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
3939.rvmrc
40+
41+ openapi-generator-cli- * .jar
Original file line number Diff line number Diff line change 2121#docs/*.md
2222# Then explicitly reverse the ignore rule for a single file:
2323#!docs/README.md
24+
25+ .gitlab-ci.yml
26+ .gitignore
27+ .travis.yml
28+ Gemfile
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env ruby
2+ # frozen_string_literal: true
3+
4+ require "bundler/setup"
5+ require "nutanix_clustermgmt"
6+
7+ # You can add fixtures and/or initialization code here to make experimenting
8+ # with your gem easier. You can also use a different console, if you like.
9+
10+ # (If you use this, don't forget to add pry to your Gemfile!)
11+ # require "pry"
12+ # Pry.start
13+
14+ require "irb"
15+ IRB . start ( __FILE__ )
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [ -z " $INPUT_SPEC_VERSION " ]; then
4+ echo " ERROR: INPUT_SPEC_VERSION must be set"
5+ exit 1
6+ fi
7+
8+ if [ -z " $OPENAPI_GENERATOR_JAR " ]; then
9+ # Detect the latest version of the openapi-generator-cli package
10+ version=` wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/maven-metadata.xml -O - 2> /dev/null | xq -x " //metadata/versioning/latest" `
11+ OPENAPI_GENERATOR_JAR=openapi-generator-cli-$version .jar
12+
13+ # Download the openapi-generator-cli jar if we don't already have it locally
14+ if [ ! -f " $OPENAPI_GENERATOR_JAR " ]; then
15+ echo " Downloading '$OPENAPI_GENERATOR_JAR '..."
16+ wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/$version /$OPENAPI_GENERATOR_JAR
17+ fi
18+ fi
19+
20+ # Clear out any existing files in paths that are autogenerated to prevent deleted files
21+ # from remaining after running the generate
22+ rm -rf ./docs ./lib ./spec
23+
24+ # Generate the gem from the current openapi-spec
25+ input_spec=https://developers.nutanix.com/api/v1/namespaces/clustermgmt/versions/$INPUT_SPEC_VERSION /yaml
26+ java -jar $OPENAPI_GENERATOR_JAR generate --input-spec $input_spec --skip-validate-spec --generator-name ruby --config .openapi-config.json
You can’t perform that action at this time.
0 commit comments