From b97a4ad12a59025fa51244d082f475315987a69a Mon Sep 17 00:00:00 2001 From: Gabriel Mazetto Date: Sun, 3 Jul 2022 10:52:32 +0100 Subject: [PATCH] Generate .gitlab-ci.yml files for Ruby template (#12750) --- .../codegen/languages/RubyClientCodegen.java | 1 + .../resources/ruby-client/gitlab-ci.mustache | 26 +++++++++++++++++++ .../petstore/ruby-faraday/.gitlab-ci.yml | 26 +++++++++++++++++++ .../ruby-faraday/.openapi-generator/FILES | 1 + samples/client/petstore/ruby/.gitlab-ci.yml | 26 +++++++++++++++++++ .../petstore/ruby/.openapi-generator/FILES | 1 + .../ruby-client/.gitlab-ci.yml | 26 +++++++++++++++++++ .../ruby-client/.openapi-generator/FILES | 1 + .../dynamic-servers/ruby/.gitlab-ci.yml | 26 +++++++++++++++++++ .../ruby/.openapi-generator/FILES | 1 + .../ruby-client/.gitlab-ci.yml | 26 +++++++++++++++++++ .../ruby-client/.openapi-generator/FILES | 1 + 12 files changed, 162 insertions(+) create mode 100644 modules/openapi-generator/src/main/resources/ruby-client/gitlab-ci.mustache create mode 100644 samples/client/petstore/ruby-faraday/.gitlab-ci.yml create mode 100644 samples/client/petstore/ruby/.gitlab-ci.yml create mode 100644 samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.gitlab-ci.yml create mode 100644 samples/openapi3/client/features/dynamic-servers/ruby/.gitlab-ci.yml create mode 100644 samples/openapi3/client/features/generate-alias-as-model/ruby-client/.gitlab-ci.yml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 1ac9398c1aaa..4d1bbeb16cfb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -251,6 +251,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen { supportingFiles.add(new SupportingFile("Gemfile.mustache", "", "Gemfile")); supportingFiles.add(new SupportingFile("rubocop.mustache", "", ".rubocop.yml")); supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); + supportingFiles.add(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml")); supportingFiles.add(new SupportingFile("gemspec.mustache", "", gemName + ".gemspec")); supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb")); supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); diff --git a/modules/openapi-generator/src/main/resources/ruby-client/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/ruby-client/gitlab-ci.mustache new file mode 100644 index 000000000000..3d57c5b30c0f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-client/gitlab-ci.mustache @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/samples/client/petstore/ruby-faraday/.gitlab-ci.yml b/samples/client/petstore/ruby-faraday/.gitlab-ci.yml new file mode 100644 index 000000000000..3d57c5b30c0f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/.gitlab-ci.yml @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index 4745216bb715..9335129107c6 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.gitlab-ci.yml .rspec .rubocop.yml .travis.yml diff --git a/samples/client/petstore/ruby/.gitlab-ci.yml b/samples/client/petstore/ruby/.gitlab-ci.yml new file mode 100644 index 000000000000..3d57c5b30c0f --- /dev/null +++ b/samples/client/petstore/ruby/.gitlab-ci.yml @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/samples/client/petstore/ruby/.openapi-generator/FILES b/samples/client/petstore/ruby/.openapi-generator/FILES index 4745216bb715..9335129107c6 100644 --- a/samples/client/petstore/ruby/.openapi-generator/FILES +++ b/samples/client/petstore/ruby/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.gitlab-ci.yml .rspec .rubocop.yml .travis.yml diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.gitlab-ci.yml b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.gitlab-ci.yml new file mode 100644 index 000000000000..3d57c5b30c0f --- /dev/null +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.gitlab-ci.yml @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/FILES b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/FILES index 113a62913f32..dfc08bbc7fa1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/FILES +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.gitlab-ci.yml .rspec .rubocop.yml .travis.yml diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/.gitlab-ci.yml b/samples/openapi3/client/features/dynamic-servers/ruby/.gitlab-ci.yml new file mode 100644 index 000000000000..3d57c5b30c0f --- /dev/null +++ b/samples/openapi3/client/features/dynamic-servers/ruby/.gitlab-ci.yml @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/FILES b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/FILES index acdf7ab23919..33ffe73a2d58 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/FILES +++ b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.gitlab-ci.yml .rspec .rubocop.yml .travis.yml diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.gitlab-ci.yml b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.gitlab-ci.yml new file mode 100644 index 000000000000..3d57c5b30c0f --- /dev/null +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.gitlab-ci.yml @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/FILES b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/FILES index f2383908cabc..3d3b3e99e4bd 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/FILES +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.gitlab-ci.yml .rspec .rubocop.yml .travis.yml