summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-10-20 15:22:29 -0700
committerGitHub <noreply@github.com>2020-10-20 15:22:29 -0700
commit4c29787c5b859e02dbc7236083d515fb29686c98 (patch)
tree9c733bf7b382ccce28dff4eb1b2c0d14e9295a04
parente005d9b85d4bad73ad4a71e007fd8ece0734b9b3 (diff)
parentdacfad4483cc4eb47c49f4a30c4bf0d685fb5648 (diff)
downloadchef-4c29787c5b859e02dbc7236083d515fb29686c98.tar.gz
Merge pull request #10540 from chef/rake_updates
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--Rakefile4
-rw-r--r--tasks/announce.rb51
-rwxr-xr-xtasks/docs.rb2
-rw-r--r--tasks/rspec.rb2
-rw-r--r--tasks/templates/release.md.erb34
5 files changed, 4 insertions, 89 deletions
diff --git a/Rakefile b/Rakefile
index 941ee692df..20249d552e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2008-2019, Chef Software Inc.
+# Copyright:: Copyright, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,7 +23,6 @@ $LOAD_PATH.unshift(File.expand_path("chef-config/lib", __dir__))
begin
require_relative "tasks/rspec"
require_relative "tasks/dependencies"
- require_relative "tasks/announce"
require_relative "tasks/docs"
require_relative "tasks/spellcheck"
require_relative "chef-utils/lib/chef-utils/dist" unless defined?(ChefUtils::Dist)
@@ -48,6 +47,7 @@ namespace :pre_install do
desc "Renders the powershell extensions with distro flavoring"
task :render_powershell_extension do
+ require "erb"
template_file = ::File.join(::File.dirname(__FILE__), "distro", "templates", "powershell", "chef", "chef.psm1.erb")
psm1_path = ::File.join(::File.dirname(__FILE__), "distro", "powershell", "chef")
FileUtils.mkdir_p psm1_path
diff --git a/tasks/announce.rb b/tasks/announce.rb
deleted file mode 100644
index f3e6fa6212..0000000000
--- a/tasks/announce.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright:: Copyright (c) Chef Software Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "date"
-require "erb"
-
-class ReleaseAnnouncement
- include ERB::Util
- attr_accessor :type, :version, :maj_minor, :date, :release_notes
-
- def initialize(version, date, type)
- @version = version
- @maj_minor = version.split(".")[0..1].join(".")
- @date = Date.parse(date) unless date.nil?
- @release_notes = release_notes_from_file
- @type = type
- end
-
- def render
- puts "-" * 30
- puts ERB.new(template_for(@type)).result(binding)
- puts "-" * 30
- end
-
- def template_for(type)
- File.read("tasks/templates/#{type}.md.erb")
- end
-
- def release_notes_from_file
- File.read("RELEASE_NOTES.md").match(/^# Chef Infra Client Release Notes #{@maj_minor}:\n\n(.*)/m)[1]
- end
-end
-
-desc "Generate the Release Announcement (version: X.Y.Z)"
-task :announce_release, :version do |t, args|
- ReleaseAnnouncement.new(args[:version], nil, "release").render
-end
diff --git a/tasks/docs.rb b/tasks/docs.rb
index 16f16e7cfe..4bce62695e 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -315,7 +315,7 @@ namespace :docs_site do
FileUtils.mkdir_p "docs_site/#{resource}"
# write out the yaml contents of the hash and append a --- since this is actually a yaml
# block in the middle of a markdown page and the block needs an ending
- File.open("docs_site/#{resource}/_index.md", "w") { |f| f.write(resource_data.to_yaml + "---") }
+ File.open("docs_site/#{resource}/_index.md", "w") { |f| f.write(YAML.dump(resource_data) + "---") }
end
end
end
diff --git a/tasks/rspec.rb b/tasks/rspec.rb
index 2bf673a5a6..929e0f91b0 100644
--- a/tasks/rspec.rb
+++ b/tasks/rspec.rb
@@ -23,7 +23,7 @@ require "rake"
begin
require "rspec/core/rake_task"
- desc "Run specs for Chef's Components"
+ desc "Run specs for Chef's Gem Components"
task :component_specs do
%w{chef-utils chef-config}.each do |gem|
Dir.chdir(gem) do
diff --git a/tasks/templates/release.md.erb b/tasks/templates/release.md.erb
deleted file mode 100644
index 366ae2b0a6..0000000000
--- a/tasks/templates/release.md.erb
+++ /dev/null
@@ -1,34 +0,0 @@
-Ohai Chefs!
-
-We're happy to announce the release of Chef v<%= @maj_minor %>!
-
-# Release Highlights
-
-<%= @release_notes %>
-
-Please see the [CHANGELOG](https://github.com/chef/chef/blob/master/CHANGELOG.md) for the complete list of changes.
-
-# Get the Build
-As always, you can download binaries directly from [downloads.chef.io](https://downloads.chef.io/chef/<%= @version %>) or by using the `mixlib-install` command line utility:
-
-```shell
-$ mixlib-install download chef -v <%= @version %>
-```
-
-Alternatively, you can install Chef using one of the following command options:
-
-```shell
-# In Shell
-$ curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef -v <%= @version %>
-
-# In Windows Powershell
-. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -project chef -version <%= @version %>
-```
-
-If you want to give this version a spin in Test Kitchen, create or add the following to your `kitchen.yml` file:
-
-```yaml
-provisioner:
- product_name: chef
- product_version: <%= @version %>
-```