Add task to verify a release.

Basically revises the release flow to:

* Update the version in RAILS_VERSION + rake changelog:header
* Run rake all:verify (click around in the booted app)
* If that checks out, run rake release.
This commit is contained in:
Kasper Timm Hansen 2017-07-22 17:49:40 +02:00
parent c1972c2640
commit 1e7acf844b
No known key found for this signature in database
GPG Key ID: 191153215EDA53D8
2 changed files with 25 additions and 1 deletions

@ -7,6 +7,9 @@ require "railties/lib/rails/api/task"
desc "Build gem files for all projects"
task build: "all:build"
desc "Build, install and verify the gem files in a generated Rails app."
task verify: "all:verify"
desc "Prepare the release"
task prep_release: "all:prep_release"

@ -142,7 +142,7 @@
task push: FRAMEWORKS.map { |f| "#{f}:push" } + ["rails:push"]
task :ensure_clean_state do
unless `git status -s | grep -v 'RAILS_VERSION\\|CHANGELOG\\|Gemfile.lock\\|package.json\\|version.rb'`.strip.empty?
unless `git status -s | grep -v 'RAILS_VERSION\\|CHANGELOG\\|Gemfile.lock\\|package.json\\|version.rb\\|tasks/release.rb'`.strip.empty?
abort "[ABORTING] `git status` reports a dirty tree. Make sure all changes are committed"
end
@ -152,6 +152,27 @@
end
end
task verify: :install do
app_name = "pkg/verify-#{version}-#{Time.now.to_i}"
sh "rails new #{app_name}"
cd app_name
sh "rails generate scaffold user name admin:boolean && rails db:migrate"
puts "Booting a Rails server. Verify the release by:"
puts
puts "- Seeing the correct release number on the root page"
puts "- Viewing /users"
puts "- Creating a user"
puts "- Updating a user (e.g. disable the admin flag)"
puts "- Deleting a user on /users"
puts "- Whatever else you want."
begin
sh "rails server"
rescue Interrupt
# Server passes along interrupt. Prevent halting verify task.
end
end
task :bundle do
sh "bundle check"
end