forked from ManageIQ/manageiq-providers-vmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ManageIQ#78 from Fryguy/split_rake_release
Add rake release task
- Loading branch information
Showing
5 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Rake::Task[:release].clear | ||
|
||
desc "Release a new project version" | ||
task :release do | ||
require 'pathname' | ||
require 'yaml' | ||
require 'more_core_extensions/core_ext/hash/nested' | ||
|
||
version = ENV["RELEASE_VERSION"] | ||
if version.nil? || version.empty? | ||
STDERR.puts "ERROR: You must set the env var RELEASE_VERSION to the proper value." | ||
exit 1 | ||
end | ||
|
||
branch = `git rev-parse --abbrev-ref HEAD`.chomp | ||
if branch == "master" | ||
STDERR.puts "ERROR: You cannot cut a release from the master branch." | ||
exit 1 | ||
end | ||
|
||
root = Pathname.new(__dir__).join("../..") | ||
|
||
# Modify the automate domain version | ||
ae_file = root.join("content/automate/ManageIQ/System/About.class/__class__.yaml") | ||
content = YAML.load_file(ae_file) | ||
content.store_path("object", "schema", 0, "field", "default_value", version) | ||
File.write(ae_file, content.to_yaml) | ||
|
||
# Create the commit and tag | ||
exit $?.exitstatus unless system("git add #{version_file}") | ||
exit $?.exitstatus unless system("git commit -m 'Release #{version}'") | ||
exit $?.exitstatus unless system("git tag #{version}") | ||
|
||
puts | ||
puts "The commit on #{branch} with the tag #{version} has been created" | ||
puts "Run the following to push to the upstream remote:" | ||
puts | ||
puts "\tgit push upstream #{branch} #{version}" | ||
puts | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace :spec do | ||
desc "Setup environment for specs" | ||
task :setup => ["app:test:initialize", "app:test:verify_no_db_access_loading_rails_environment", "app:test:setup_db"] | ||
end | ||
|
||
RSpec::Core::RakeTask.new(:spec => ["app:test:initialize", "app:evm:compile_sti_loader"]) do |t| | ||
spec_dir = File.expand_path("../../spec", __dir__) | ||
EvmTestHelper.init_rspec_task(t, ['--require', File.join(spec_dir, 'spec_helper')]) | ||
t.pattern = FileList[spec_dir + '/**/*_spec.rb'].exclude(spec_dir + '/manageiq/**/*_spec.rb') | ||
end |