Skip to content

Commit

Permalink
Merge pull request #2 from liger1978/fixup
Browse files Browse the repository at this point in the history
Manual fixups, don't git ignore build scripts
  • Loading branch information
liger1978 authored Oct 6, 2021
2 parents 398c354 + 698adc9 commit d50c121
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ These APIs provide services for manipulating Harbor project.
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 2.0
- Package version: 2.3.3.0
- Package version: 2.3.3.1
- Build package: io.swagger.codegen.languages.RubyClientCodegen

## Installation
Expand All @@ -23,15 +23,15 @@ gem build harbor2_client.gemspec
Then either install the gem locally:

```shell
gem install ./harbor2_client-2.3.3.0.gem
gem install ./harbor2_client-2.3.3.1.gem
```
(for development, run `gem install --dev ./harbor2_client-2.3.3.0.gem` to install the development dependencies)
(for development, run `gem install --dev ./harbor2_client-2.3.3.1.gem` to install the development dependencies)

or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).

Finally add this to the Gemfile:

gem 'harbor2_client', '~> 2.3.3.0'
gem 'harbor2_client', '~> 2.3.3.1'

### Install from Git

Expand Down
8 changes: 8 additions & 0 deletions build_scripts/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# 1. Create a new git branch
# 2. Clean out repo (delete everything except build_scripts folder and .git folder)
# 3. Update version in swagger-codegen-cli-ruby-config.json
# 4. Run this script from the root of the repo ( e.g. "build_scripts/generate.sh 2.3.3")
# 5. Check previous commits to check required manual fixups (may or may not stil be required)
version=$1
docker run -u $(id -u) --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate -i "https://raw.githubusercontent.com/goharbor/harbor/v${version}/api/v2.0/swagger.yaml" -l ruby -c /local/build_scripts/swagger-codegen-cli-ruby-config.json -o /local/
12 changes: 12 additions & 0 deletions build_scripts/swagger-codegen-cli-ruby-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"gemName": "harbor2_client",
"moduleName": "Harbor2Client",
"gemVersion": "2.3.3.1",
"gemLicense": "MIT",
"gemRequiredRubyVersion": ">= 1.9",
"gemHomepage": "https://github.com/liger1978/ruby-harbor2_client",
"gemSummary": "A ruby wrapper for the Harbor swagger APIs",
"gemDescription": "A ruby wrapper for the Harbor swagger APIs",
"gemAuthor": "Richard Grainger",
"gemAuthorEmail": "[email protected]"
}
12 changes: 6 additions & 6 deletions lib/harbor2_client/models/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def self.attribute_map
{
:'architecture' => :'architecture',
:'os' => :'os',
:'os_version' => :''os.version'',
:'os_features' => :''os.features'',
:'os_version' => :'os.version',
:'os_features' => :'os.features',
:'variant' => :'variant'
}
end
Expand Down Expand Up @@ -67,12 +67,12 @@ def initialize(attributes = {})
self.os = attributes[:'os']
end

if attributes.has_key?(:''os.version'')
self.os_version = attributes[:''os.version'']
if attributes.has_key?(:'os.version')
self.os_version = attributes[:'os.version']
end

if attributes.has_key?(:''os.features'')
if (value = attributes[:''os.features'']).is_a?(Array)
if attributes.has_key?(:'os.features')
if (value = attributes[:'os.features']).is_a?(Array)
self.os_features = value
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/harbor2_client/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module Harbor2Client
VERSION = '2.3.3.0'
VERSION = '2.3.3.1'
end

0 comments on commit d50c121

Please sign in to comment.