Commit | Line | Data |
---|---|---|
4559aa03 S |
1 | require 'rugged' |
2 | ||
3 | task default: %w[build] | |
4 | ||
5 | task :build do | |
6 | repo = Rugged::Repository.new('.') | |
7 | commit = repo.head.target | |
8 | parent = commit.parents.first | |
9 | paths = commit.diff(parent).deltas.map { |d| d.new_file[:path] } | |
10 | paths = paths.map { |p| Pathname.new(p).each_filename.to_a } | |
11 | # looking for packages/[package]/... | |
12 | packages = paths.map { |p| p[1] if p.length > 2 and p[0] == "packages" } | |
13 | packages = packages.flatten.uniq | |
14 | packages.each do |package| | |
15 | puts package | |
16 | printf `./scripts/run-docker.sh ./build-package.sh #{package}` | |
17 | end | |
18 | end |