diff options
author | Peter Wilmott <p@p8952.info> | 2015-08-15 19:51:00 +0100 |
---|---|---|
committer | Peter Wilmott <p@p8952.info> | 2015-08-15 20:44:36 +0100 |
commit | 7e3a8f32a4d99b042e914d382e37e8e31f3a1832 (patch) | |
tree | 1de51ea472e851d33c2e06746f3418f565c5409d /web | |
parent | Drop unused tested col (diff) | |
download | ruby-tinderbox-7e3a8f32a4d99b042e914d382e37e8e31f3a1832.tar.gz ruby-tinderbox-7e3a8f32a4d99b042e914d382e37e8e31f3a1832.tar.bz2 ruby-tinderbox-7e3a8f32a4d99b042e914d382e37e8e31f3a1832.zip |
List what new target was added on the new targets page
Diffstat (limited to 'web')
-rw-r--r-- | web/db/migrations/020_add_next_target.rb | 5 | ||||
-rw-r--r-- | web/lib/ci.rb | 26 | ||||
-rw-r--r-- | web/lib/packages.rb | 11 | ||||
-rw-r--r-- | web/views/bumps/new_targets.erb | 2 |
4 files changed, 23 insertions, 21 deletions
diff --git a/web/db/migrations/020_add_next_target.rb b/web/db/migrations/020_add_next_target.rb new file mode 100644 index 0000000..eae3ec3 --- /dev/null +++ b/web/db/migrations/020_add_next_target.rb @@ -0,0 +1,5 @@ +Sequel.migration do + change do + add_column :packages, :next_target, String + end +end diff --git a/web/lib/ci.rb b/web/lib/ci.rb index 2388160..c899e4f 100644 --- a/web/lib/ci.rb +++ b/web/lib/ci.rb @@ -4,13 +4,12 @@ def run_ci(volume_container, ci_image, ci_type, num_of_packages) packages.peach(8) do |package| package = package.split(' ') identifier = package[0] - current_target = package[1] - next_target = package[2] + next_target = package[1] if ci_type == 'build' - cmd = %W(/ruby-tinderbox/tinder.sh #{identifier} #{current_target} #{next_target}) + cmd = %W(/ruby-tinderbox/tinder.sh #{identifier} #{next_target}) elsif ci_type == 'repoman' - cmd = %W(/ruby-tinderbox/repoman.sh #{identifier} #{current_target} #{next_target}) + cmd = %W(/ruby-tinderbox/repoman.sh #{identifier} #{next_target}) end ci_container = Docker::Container.create( Cmd: cmd, @@ -29,7 +28,7 @@ def run_ci(volume_container, ci_image, ci_type, num_of_packages) tar.close tar.unlink - ci_container.delete + #ci_container.delete end end @@ -64,7 +63,8 @@ def generate_package_list(ci_type, num_of_packages) end end elsif num_of_packages.is_a?(Integer) - packages = packages.sample(num_of_packages) + puts packages.count + packages = packages[25..(25 + num_of_packages)] else puts 'ERROR: Invalid value for NUM_OF_PACKAGES' puts ci_type @@ -75,19 +75,7 @@ def generate_package_list(ci_type, num_of_packages) packages_with_targets = [] packages.uniq.each do |package| package = Package.where(identifier: package).first - - target = 'unknown' - target = package[:r19_target] unless package[:r19_target] == 'nil' - target = package[:r20_target] unless package[:r20_target] == 'nil' - target = package[:r21_target] unless package[:r21_target] == 'nil' - target = package[:r22_target] unless package[:r22_target] == 'nil' - - next_target = 'unknown' - next_target = 'ruby20' if target == 'ruby19' - next_target = 'ruby21' if target == 'ruby20' - next_target = 'ruby22' if target == 'ruby21' - - packages_with_targets << "#{package[:identifier]} #{target} #{next_target}" + packages_with_targets << "#{package[:identifier]} #{package[:next_target]}" end packages_with_targets diff --git a/web/lib/packages.rb b/web/lib/packages.rb index 7a3e8db..f8bc4a6 100644 --- a/web/lib/packages.rb +++ b/web/lib/packages.rb @@ -13,9 +13,17 @@ def update_packages(ci_image) packages_txt.peach do |line| next if line.empty? sha1, category, name, version, revision, slot, amd64_keyword, r19_target, r20_target, r21_target, r22_target = line.split(' ') + identifier = category + '/' + name + '-' + version + (revision == 'r0' ? '' : "-#{revision}") + gem_version = Gems.info(name)['version'] gem_version = 'nil' if gem_version.nil? + + next_target = 'nil' + next_target = 'ruby20' if r19_target == 'ruby19' && r20_target == 'nil' + next_target = 'ruby21' if r20_target == 'ruby20' && r21_target == 'nil' + next_target = 'ruby22' if r21_target == 'ruby21' && r22_target == 'nil' + package = Package.find_or_create( sha1: sha1, category: category, @@ -29,7 +37,8 @@ def update_packages(ci_image) r20_target: r20_target, r21_target: r21_target, r22_target: r22_target, - gem_version: gem_version + next_target: next_target, + gem_version: gem_version, ) deps = line.split(' ').drop(11).join.gsub(';', ' ') package.update(dependencies: deps) diff --git a/web/views/bumps/new_targets.erb b/web/views/bumps/new_targets.erb index d5a605b..c2084dc 100644 --- a/web/views/bumps/new_targets.erb +++ b/web/views/bumps/new_targets.erb @@ -29,7 +29,7 @@ <%packages.each do |package|%> <tr> <td class="width-52"> - <%=package[0][:identifier]%> + <%=package[0][:identifier]%> <sup>+<%=package[0][:next_target]%></sup> </td> <td class="width-12 <%=package[1][:result]%>"> <%=package[1][:result].camelcase%> |