You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
557 B

require 'rugged'
task default: %w[build]
task :build do
repo = Rugged::Repository.new('.')
commit = repo.head.target
parent = commit.parents.first
paths = commit.diff(parent).deltas.map { |d| d.new_file[:path] }
paths = paths.map { |p| Pathname.new(p).each_filename.to_a }
# looking for packages/[package]/...
packages = paths.map { |p| p[1] if p.length > 2 and p[0] == "packages" }
packages = packages.flatten.uniq
packages.each do |package|
puts package
printf `./scripts/run-docker.sh ./build-package.sh #{package}`
end
end