Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.
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.0...HEAD)

**Fixed bugs:**

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

## [v1.0.0](https://github.com/codenamephp/chef.cookbook.bash/tree/v1.0.0) (2018-09-02)
**Implemented enhancements:**

Expand Down
17 changes: 10 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ def concurrency
end

def origin_branch
ENV['TRAVIS_PULL_REQUEST_BRANCH'].presence || ENV['TRAVIS_BRANCH'].presence || 'dev'
ENV['TRAVIS_PULL_REQUEST_BRANCH'].presence || ENV['TRAVIS_BRANCH'].presence || 'master'
end

task default: %w[style unit integration]

namespace :git do
desc 'Setting up git for pushing'
task :setup do
sh 'git config --local user.name "Travis CI"'
sh 'git config --local user.email "[email protected]"'
sh 'git remote set-url --push origin "https://' + ENV['GH_TOKEN'].to_s + '@github.com/' + ENV['TRAVIS_REPO_SLUG'] + '.git"', verbose: false
if ENV['TRAVIS']
sh 'git config --local user.name "Travis CI"'
sh 'git config --local user.email "[email protected]"'
sh 'git remote set-url --push origin "https://' + ENV['GH_TOKEN'].to_s + '@github.com/' + ENV['TRAVIS_REPO_SLUG'] + '.git"', verbose: false
end
end
end

Expand Down Expand Up @@ -124,10 +126,11 @@ task :integration, %i[regexp action concurrency] => ci? || use_dokken? ? %w[inte
namespace :documentation do
desc 'Generate changelog'
task changelog: ['git:setup'] do
unless File.directory?('.tmp')
sh 'git clone "https://' + ENV['GH_TOKEN'].to_s + '@github.com/' + ENV['TRAVIS_REPO_SLUG'] + '.git" --branch ' + origin_branch + ' --single-branch .tmp'
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('.tmp') do
Dir.chdir(branch_repo) do
sh "github_changelog_generator -t #{ENV['GH_TOKEN']}"
sh 'git status'
sh 'git add CHANGELOG.md && git commit --allow-empty -m"[skip ci] Updated changelog" && git push origin ' + origin_branch
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.0'
version '1.0.1'
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