|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +# Licensed to Elasticsearch B.V. under one or more contributor |
| 4 | +# license agreements. See the NOTICE file distributed with |
| 5 | +# this work for additional information regarding copyright |
| 6 | +# ownership. Elasticsearch B.V. licenses this file to you under |
| 7 | +# the Apache License, Version 2.0 (the "License"); you may |
| 8 | +# not use this file except in compliance with the License. |
| 9 | +# You may obtain a copy of the License at |
| 10 | +# |
| 11 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +# |
| 13 | +# Unless required by applicable law or agreed to in writing, |
| 14 | +# software distributed under the License is distributed on an |
| 15 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | +# KIND, either express or implied. See the License for the |
| 17 | +# specific language governing permissions and limitations |
| 18 | +require_relative '../elasticsearch/lib/elasticsearch/version.rb' |
| 19 | +CURRENT_VERSION = Elasticsearch::VERSION |
| 20 | + |
| 21 | +desc 'Bump versions' |
| 22 | +task :bump, [:version] do |_, args| |
| 23 | + raise ArgumentError, 'You must specify a version: rake bump[8.0.0]' unless args[:version] |
| 24 | + |
| 25 | + Rake::Task['update_version'].invoke(CURRENT_VERSION, args[:version]) |
| 26 | +end |
| 27 | + |
| 28 | +desc 'Build release gem files' |
| 29 | +task :build, [:output_dir] do |_, args| |
| 30 | + raise ArgumentError, 'You must specify an output dir: rake build[output_dir]' unless args[:output_dir] |
| 31 | + |
| 32 | + RELEASE_TOGETHER.each do |gem| |
| 33 | + puts '-' * 80 |
| 34 | + puts "Building #{gem} v#{CURRENT_VERSION} to #{args[:output_dir]}" |
| 35 | + sh "cd #{CURRENT_PATH.join(gem)} && gem build --silent && mv *.gem #{CURRENT_PATH.join(args[:output_dir])}" |
| 36 | + end |
| 37 | + puts '-' * 80 |
| 38 | +end |
0 commit comments