Skip to content

Commit 6328a07

Browse files
committed
[Generator] Updates automation rake task for code generation
1 parent bb50ec5 commit 6328a07

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

rake_tasks/automation.rake

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,18 @@ namespace :automation do
3838

3939
desc 'Generate API code'
4040
task :codegen do
41-
version = YAML.load_file(File.expand_path("#{__dir__}/../.buildkite/pipeline.yml"))['steps'].first['env']['STACK_VERSION']
41+
path = File.expand_path('../elasticsearch-api/', __dir__)
42+
branch = YAML.load_file(File.expand_path("#{__dir__}/../.buildkite/pipeline.yml"))['steps'].first['env']['ES_YAML_TESTS_BRANCH']
43+
unless File.exist?(File.expand_path('elastic-client-generator-ruby', __dir__))
44+
sh "git clone https://#{ENV['CLIENTS_GITHUB_TOKEN']}@github.com/elastic/elastic-client-generator-ruby.git "
45+
end
4246

43-
Rake::Task['es:download_artifacts'].invoke(version)
44-
sh "cd #{CURRENT_PATH.join('elasticsearch-api/utils')} \
45-
&& BUNDLE_GEMFILE=`pwd`/Gemfile \
46-
&& bundle exec thor code:generate"
47+
sh "export ES_RUBY_CLIENT_PATH=#{path} " \
48+
' && cd elastic-client-generator-ruby/elasticsearch ' \
49+
" && rake update[#{branch}]" \
50+
' && rake gen_es' \
51+
' && cd ../../ ' \
52+
' && rm -rf elastic-client-generator-ruby '
4753
end
4854

4955
desc <<-DESC

rake_tasks/elasticsearch_tasks.rake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ namespace :es do
7373
abort e.message
7474
end
7575

76-
desc 'Download artifacts (tests and REST spec) for currently running cluster'
76+
# Deprecated
77+
desc 'Download Elasticsearch artifacts (tests and REST spec) for currently running cluster'
7778
task :download_artifacts, :version do |_, args|
7879
json_filename = CURRENT_PATH.join('tmp/artifacts.json')
7980

0 commit comments

Comments
 (0)