Skip to content

Commit

Permalink
Add acceptance to the rake tasks (#7).
Browse files Browse the repository at this point in the history
  • Loading branch information
dallinb committed Dec 25, 2016
1 parent 8397147 commit e730acd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,23 @@ require 'puppet-strings/tasks'
Blacksmith::RakeTask.new do |t|
t.tag_pattern = '%s'
end

desc '[CI Only] Run beaker, but only for pull requests or for release branches.'
task :acceptance do
skip = true
travis_branch = ENV['TRAVIS_BRANCH']
travis_event_type = ENV['TRAVIS_EVENT_TYPE']

if travis_event_type == 'pull_request'
skip = false
elsif travis_event_type == 'push'
skip = false if travis_branch =~ /^release-/ || travis_branch =~ /^hotfix-/
end

if skip
puts 'Skipping acceptance tests.'
exit(0)
else
Rake::Task['beaker'].invoke
end
end

0 comments on commit e730acd

Please sign in to comment.