Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ deploy:
script: chef exec rake release

after_script:
- chef exec rake documentation
- test $TRAVIS_PULL_REQUEST = false && chef exec rake documentation
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## [Unreleased](https://github.com/codenamephp/chef.cookbook.bash/tree/HEAD)

[Full Changelog](https://github.com/codenamephp/chef.cookbook.bash/compare/v1.0.1...HEAD)

**Fixed bugs:**

- Changelog: Version not respected after release [\#6](https://github.com/codenamephp/chef.cookbook.bash/issues/6)

## [v1.0.1](https://github.com/codenamephp/chef.cookbook.bash/tree/v1.0.1) (2018-09-02)
[Full Changelog](https://github.com/codenamephp/chef.cookbook.bash/compare/v1.0.0...v1.0.1)

Expand Down
10 changes: 6 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,26 @@ desc 'Run Test Kitchen integration tests'
task :integration, %i[regexp action concurrency] => ci? || use_dokken? ? %w[integration:dokken] : %w[integration:vagrant]

namespace :documentation do
version_match = Regexp.new('\[RELEASE\s([\d\.]+)\]').match(ENV['TRAVIS_COMMIT_MESSAGE'])

desc 'Generate changelog'
task changelog: ['git:setup'] do
branch_repo = "/#{Dir.home}/#{ENV['TRAVIS_REPO_SLUG']}"

unless File.directory?(branch_repo)
sh "git clone 'https://#{ENV['GH_TOKEN']}@github.com/#{ENV['TRAVIS_REPO_SLUG']}.git' --branch #{origin_branch} --single-branch #{branch_repo}"
end
Dir.chdir(branch_repo) do
sh "github_changelog_generator -t #{ENV['GH_TOKEN']}"
sh format("github_changelog_generator -t #{ENV['GH_TOKEN']} %<version>s", version: ("--future-release #{version_match[1]}" unless version_match.nil?))
sh 'git status'
sh 'git add CHANGELOG.md && git commit --allow-empty -m"[skip ci] Updated changelog" && git push origin ' + origin_branch
end
end

desc 'Generate changelog from current commit message for release'
task changelog_release: ['git:setup'] do
match = Regexp.new('\[RELEASE\s([\d\.]+)\]').match(ENV['TRAVIS_COMMIT_MESSAGE'])
unless match.nil?
sh "github_changelog_generator -t #{ENV['GH_TOKEN']} --future-release #{match[1]}"
unless version_match.nil?
sh "github_changelog_generator -t #{ENV['GH_TOKEN']} %s--future-release #{version_match[1]}"
sh 'git status'
sh 'git add CHANGELOG.md && git commit --allow-empty -m"[skip ci] Updated changelog" && git push origin ' + ENV['TRAVIS_BRANCH']
end
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache-2.0'
description 'Makes sure bash is installed and handles bash configurations'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.1'
version '1.0.2'
chef_version '>= 13.0' if respond_to?(:chef_version)
issues_url 'https://github.com/codenamephp/chef.cookbook.bash/issues' if respond_to?(:issues_url)
source_url 'https://github.com/codenamephp/chef.cookbook.bash' if respond_to?(:source_url)
Expand Down