Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit ffbac5c

Browse files
committed
Update rake whatsnew
Exit with error when Missing whatsnew to fail jenkins build
1 parent 5095504 commit ffbac5c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Rakefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ task :whatsnew do
7878
print 'Generating data for the What\'s New digest: $ '.magenta
7979

8080
# Generate tmp/whats-new.yml
81-
if since.nil? || since.empty?
82-
sh 'bin/whatsup_github', 'since', last_update
83-
elsif since.is_a? String
84-
sh 'bin/whatsup_github', 'since', since
85-
else
86-
abort 'The "since" argument must be a string. Example: "jul 4"'
87-
end
81+
report =
82+
if since.nil? || since.empty?
83+
`bin/whatsup_github since '#{last_update}'`
84+
elsif since.is_a? String
85+
`bin/whatsup_github since #{since}`
86+
else
87+
abort 'The "since" argument must be a string. Example: "jul 4"'
88+
end
8889

8990
# Merge generated tmp/whats-new.yml with existing src/_data/whats-new.yml
9091
generated_data = YAML.load_file generated_file
@@ -94,6 +95,9 @@ task :whatsnew do
9495

9596
puts "Writing updates to #{current_file}"
9697
File.write current_file, current_data.to_yaml
98+
99+
abort report if report.include? 'MISSING whatsnew'
100+
puts report
97101
end
98102

99103
desc 'Generate index for Algolia'

0 commit comments

Comments
 (0)