Permalink
Browse files

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.
  • Loading branch information...
kaspth committed Jul 22, 2017
1 parent c1972c2 commit 1e7acf844ba04cb4abf02737ee8bebb2ecce6012
Showing with 25 additions and 1 deletion.
  1. +3 −0 Rakefile
  2. +22 −1 tasks/release.rb
View
@@ -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"
View
@@ -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

0 comments on commit 1e7acf8

Please sign in to comment.