Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# Works with Integrity version's >= 0.2.0 and < 0.2.9
desc "Will build the latest commit for any git project that has already been built and the latest commit has not already been built"
task :build_new_commits do
require "init"
Integrity.log("Checking for new commits at #{Time.now}")
Integrity::Project.all.each do |project|
# Don't build if project is just being set up, or a build of 'HEAD' is already outstanding or the latest commit has already
# been built.
unless project.blank? ||
project.last_build.commit.identifier == 'HEAD' ||
(head = Bob::Builder.new(project).send(:scm).head) == project.last_build.commit.identifier
project.build(head)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment