diff options
-rw-r--r-- | Rakefile | 3 | ||||
-rw-r--r-- | tasks/release.rb | 23 |
2 files changed, 25 insertions, 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" diff --git a/tasks/release.rb b/tasks/release.rb index 038fdc584a..ae16e6b80c 100644 --- a/tasks/release.rb +++ b/tasks/release.rb @@ -142,7 +142,7 @@ namespace :all do 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 @@ namespace :all do 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 |