Skip to content

Commit 7f777b7

Browse files
committed
[CI] Updates generate code task for automation
1 parent 6ebc99e commit 7f777b7

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

.ci/make.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,8 @@ case $CMD in
6363
TASK_ARGS=("$VERSION" "$output_folder")
6464
;;
6565
codegen)
66-
if [ -v $VERSION ]; then
67-
echo -e "\033[31;1mTARGET: codegen -> missing version parameter\033[0m"
68-
exit 1
69-
fi
70-
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
7166
TASK=codegen
72-
# VERSION is BRANCH here for now
73-
TASK_ARGS=("$VERSION" "$codegen_folder")
67+
TASK_ARGS=()
7468
;;
7569
docsgen)
7670
if [ -v $VERSION ]; then
@@ -154,10 +148,6 @@ if [[ "$CMD" == "assemble" ]]; then
154148
fi
155149
fi
156150

157-
if [[ "$CMD" == "codegen" ]]; then
158-
echo "TODO"
159-
fi
160-
161151
if [[ "$CMD" == "docsgen" ]]; then
162152
echo "TODO"
163153
fi

Rakefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,3 @@ task :release do
130130
puts '-' * 80
131131
end
132132
end
133-
134-
desc 'Generate API code'
135-
task :generate do
136-
sh "cd #{CURRENT_PATH.join('elasticsearch-api/utils')} && bundle exec thor code:generate"
137-
end

rake_tasks/elasticsearch_tasks.rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ namespace :elasticsearch do
8282
end
8383

8484
desc 'Download artifacts (tests and REST spec) for currently running cluster'
85-
task :download_artifacts do
85+
task :download_artifacts, :version do |_, args|
8686
json_filename = CURRENT_PATH.join('tmp/artifacts.json')
8787

88-
unless (version_number = ENV['STACK_VERSION'])
88+
unless (version_number = args[:version] || ENV['STACK_VERSION'])
8989
# Get version number and build hash of running cluster:
9090
version_number = cluster_info['number']
9191
build_hash = cluster_info['build_hash']

rake_tasks/unified_release_tasks.rake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ namespace :unified_release do
5757
"zip -r #{@zip_filename}.zip * " \
5858
end
5959

60+
desc 'Generate API code'
61+
task :codegen do
62+
version = YAML.load_file(File.expand_path(__dir__ + '/../.ci/test-matrix.yml'))['STACK_VERSION'].first
63+
Rake::Task['elasticsearch:download_artifacts'].invoke(version)
64+
sh "cd #{CURRENT_PATH.join('elasticsearch-api/utils')} \
65+
&& BUNDLE_GEMFILE=`pwd`/Gemfile \
66+
&& bundle exec thor code:generate"
67+
end
68+
6069
desc <<-DESC
6170
Update Rubygems versions in version.rb and *.gemspec files
6271

0 commit comments

Comments
 (0)