summaryrefslogtreecommitdiffstats
path: root/tasks/rake/testbranch.rake
blob: 62304ea0ebe6da1b067c73bb0971668d1ce29a82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
desc "Rebuild the 'test' branch"
task :testbranch do
    TEST_SERIES = %x{git config --get puppet.testseriesfile}.chomp

    sh 'git checkout master'
    if %x{git branch}.split("\n").detect { |l| l =~ /\s+test$/ }
        sh 'git branch -D test'
    end
    sh 'git checkout -b test'
    File.readlines(TEST_SERIES).each do |line|
        line.chomp!

        # Always create a commit for our merge
        sh "git merge --no-ff #{line}"
    end
end