From 1e7acf844ba04cb4abf02737ee8bebb2ecce6012 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sat, 22 Jul 2017 17:49:40 +0200 Subject: 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. --- Rakefile | 3 +++ tasks/release.rb | 23 ++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index ae269fbce7..1421851900 100644 --- a/Rakefile +++ b/Rakefile @@ -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 -- cgit v1.2.3