[SCM] ci-tooling packaging branch, master, updated. 76f9ec487cf00f2b27d156554f71857157fba55d

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue Feb 24 09:52:19 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=76f9ec4

The following commit has been merged in the master branch:
commit 76f9ec487cf00f2b27d156554f71857157fba55d
Author: Harald Sitter <sitter at kde.org>
Date:   Tue Feb 24 10:52:12 2015 +0100

    ditch backup file
---
 kci/daily-promote.rb.bak | 307 -----------------------------------------------
 1 file changed, 307 deletions(-)

diff --git a/kci/daily-promote.rb.bak b/kci/daily-promote.rb.bak
deleted file mode 100644
index 3df7093..0000000
--- a/kci/daily-promote.rb.bak
+++ /dev/null
@@ -1,307 +0,0 @@
-#!/usr/bin/env ruby
-
-ENV['PATH'] = '/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin'
-Dir.chdir('/tmp/') # Containers by default have a bugged out pwd, force /tmp.
-
-require_relative "lib/require_or_install"
-
-install_and_require "logger"
-install_and_require "thwait"
-install_and_require "logger/colors"
-require_relative "lib/jenkins"
-require_relative "lib/lp"
-
-$logger = Logger.new(STDERR)
-$logger.level = Logger::INFO
-
-Project = Struct.new(:series, :stability)
-# get basename, distro series, unstable/stable
-raise 'Did not get valid arguments' unless ARGV.size == 2
-project = Project.new(ARGV[0], ARGV[1])
-
-jenkins = new_jenkins
-job_names = jenkins.job.list("^#{project.series}_#{project.stability}_.*")
-
-job_name_queue = Queue.new
-job_names.each do |name|
-    job_name_queue << name
-end
-
-# Check status of the jobs through a very simply threaded queue.
-# This allows $threadcount concurrent connections which is heaps
-# faster than doing this sequentially. In particular when run
-# outside localhost.
-# threads = []
-# 16.times do
-#     threads << Thread.new do
-#         jenkins = new_jenkins
-#         while name = job_name_queue.pop(true) do
-#             begin
-#                 if jenkins.job.status(name) != 'success' \
-#                         or jenkins.job.status(name) != 'unstable' \
-#                         or jenkins.queue.list.include?(name)
-#                     $logger.error "#{name} does not qualify for snapshot. Aborting."
-#                     exit 1
-#                 end
-#             rescue
-#                 retry
-#             end
-#         end
-#     end
-# end
-
-# ThreadsWait.all_waits(threads)
-
-$logger.info "All Jenkins jobs seem jolly alright"
-
-Launchpad::authenticate
-
-# class CiPPA
-#     attr_reader :type
-#     attr_reader :series
-#
-#     def initialize(type, series)
-#         @type = type
-#         @series = series
-#         @added = false
-#         @packages = {}
-#     end
-#
-#     def add
-#         return if @added
-#         $logger.info "Adding PPA #{@type} to apt."
-#         system('apt-get install -y --no-install-recommends software-properties-common eatmydata')
-#         system("apt-add-repository -y -m ppa:kubuntu-ci/#{@type}")
-#         system('apt-get update')
-#         @added = true
-#     end
-#
-#     def remove
-#         # Always remove even if !@added to make sure it is really gone.
-#         $logger.info "Removing PPA #{@type} from apt."
-#         system('apt-get install -y --no-install-recommends software-properties-common eatmydata')
-#         system("apt-add-repository -y -r -m ppa:kubuntu-ci/#{@type}")
-#         system('apt-get update')
-#         @added = false
-#     end
-#
-#     def packages
-#         return @packages unless @packages.empty?
-#
-#         $logger.info "Building package list for PPA #{@type}."
-#
-# #         # TODO: this presently does not take multiarch into account.
-# #         Dir.glob("/var/lib/apt/lists/ppa.launchpad.net_kubuntu-ci_#{@type}_*_Packages") do |cache_file|
-# #             file = File.open(cache_file, 'r')
-# #             while !file.eof?
-# #                 line = file.readline
-# #                 match = line.match(/^Package: (.*)$/)
-# #                 next unless match and match.size == 2 # fullmatch + name match
-# #                 @packages << match[1]
-# #             end
-# #         end
-# #         @packages.uniq!
-# #         @packages.delete_if { |p| p.end_with?('-dbg') || p.end_with?('-data') }
-# #         @packages.sort!
-#
-#         ubuntu = Launchpad::Rubber::from_json(Net::HTTP.get(URI('https://api.launchpad.net/1.0/ubuntu')))
-#         series = nil
-#         ubuntu.series.each do |_series|
-#             next unless _series.name == @series
-#             series = _series
-#             break
-#         end
-#
-#         reference_distro_arch_series_link = nil
-#         series.architectures.each do |_arch|
-#             # FIXME: arch harcode
-#             next unless _arch.architecture_tag == 'amd64'
-#             reference_distro_arch_series_link = _arch.self_link
-#             break
-#         end
-#
-#         ppas = Launchpad::Rubber::from_json(Net::HTTP.get(URI('https://api.launchpad.net/1.0/~kubuntu-ci/ppas'))).entries
-#         p ppas
-#         ppa = nil
-#         ppas.each do |_ppa|
-#             p _ppa.name
-#             next unless _ppa.name == @type
-#             ppa = _ppa
-#             break
-#         end
-#
-#         packages = {}
-#         # ppa.getPublishedBinaries(:ordered => false,
-#         #                          :status => 'Published',
-#         #                          :distro_arch_series => reference_distro_arch_series_link).each do |binary|
-#         #     packages[binary.binary_package_name] = binary.binary_package_version
-#         # end
-#         ppa.getPublishedSources(:status => 'Published',
-#                                 :distro_series => series).each do |source|
-#             binaries = source.getPublishedBinaries()
-#             binaries.each do |binary|
-# #                 puts "archspecific: #{binary.architecture_specific} . #{binary.binary_package_name} . #{binary.binary_package_version}"
-#                 next if binary.binary_package_name.end_with?('-dbg')
-#                 # Do not include known to conflict packages
-#                 next if binary.binary_package_name == 'libqca2-dev'
-#                 if binary.architecture_specific
-#                     next unless binary.distro_arch_series_link == reference_distro_arch_series_link
-#                 end
-#                 packages[binary.binary_package_name] = binary.binary_package_version
-#             end
-#         end
-#
-#         $logger.info "Built package list: #{packages.keys().join(", ")}"
-#         return @packages = packages
-#     end
-#
-#     def install
-#         $logger.info "Installing PPA #{@type}."
-#         p packages.map{|k,v| "#{k}='#{v}'"}.join(' ')
-#         pin!
-#         return system("apt-get install --force-yes -y -o 'Debug::pkgProblemResolver=true' ubuntu-minimal upstart #{packages.map{|k,v| "#{k}='#{v}'"}.join(' ')}")
-#     end
-#
-#     def purge
-#         $logger.info "Purging PPA #{@type}."
-#         return system("apt-get purge --force-yes -y #{packages.keys().join(' ')}")
-#     end
-#
-# private
-#     def pin!
-#         File.open('/etc/apt/preferences.d/superpin', 'w') do |file|
-#             file << "Package: *
"
-#             file << "Pin: release o=LP-PPA-kubuntu-ci-#{@type}
"
-#             file << "Pin-Priority: 999
"
-#         end
-#     end
-# end
-#
-# daily_ppa = CiPPA.new("#{project.stability}-daily", project.series)
-# live_ppa = CiPPA.new("#{project.stability}", project.series)
-# live_ppa.remove() # remove live before attempting to use daily.
-#
-# # Add the present daily snapshot, install everything.
-# # If this fails then the current snapshot is kaputsies....
-# # daily_ppa.add()
-# daily_ppa.add()
-# unless daily_ppa.install()
-#     $logger.info "daily ppa failed to install."
-#     daily_purged = daily_ppa.purge()
-#     unless daily_purged
-#         $logger.info "daily failed to install and then failed to purge. Maybe check maintscripts?"
-#     end
-# end
-#
-# # NOTE: If daily failed to install, no matter if we can upgrade live it is
-# # an improvement just as long as it can be installed...
-# # So we purged daily again, and even if that fails we try to install live
-# # to see what happens. If live is ok we are good, otherwise we would fail anyway.
-#
-# live_ppa.add()
-# unless live_ppa.install()
-#     $logger.error "all is vain! live PPA is not installing!"
-#     exit 1
-# end
-#
-# # All is lovely. Let's make sure all live packages uninstall again (maintscripts!)
-# # and then start the promotion.
-# unless live_ppa.purge()
-#     $logger.error "live PPA installed just fine, but can't be uninstalled again. Maybe check maintscripts?"
-#     exit 1
-# end
-
-
-$logger.info "Everything is lovely. Copying things for real now."
-
-ubuntu = Launchpad::Rubber::from_url("https://api.launchpad.net/devel/ubuntu")
-series = nil
-ubuntu.series.each do |_series|
-    next unless _series.name == 'utopic'
-    series = _series
-    break
-end
-
-class Archive
-    attr_accessor :ppa
-
-    def initialize(name, series)
-        @name = name
-        @ppa = Launchpad::Rubber::from_url("https://api.launchpad.net/devel/~kubuntu-ci/+archive/ubuntu/#{name}")
-        @series = series
-        @published = nil
-    end
-
-    def wipe
-        @published = nil
-        # We need to iter clear as Deleted entries would still retain their entry
-        # making the unfiltered list grow larger and larger every time.
-        each_source do |source|
-            $logger.info "Requesting deletion of: #{source.source_package_name} from #{@name}"
-            begin
-                source.requestDeletion!()
-#             rescue => e
-#                 $logger.warn "failed to request deletion, retry"
-#                 p e
-#                 exit 1
-#                 retry
-            end
-        end
-    end
-
-    def copy(from_ppa)
-        @published = nil
-        from_ppa.each_source(:Published) do |source|
-            $logger.info "Copying source: #{source.source_package_name} (#{source.source_package_version})"
-            begin
-                @ppa.copyPackage!(:from_archive => from_ppa.ppa,
-                                  :source_name => source.source_package_name,
-                                  :version => source.source_package_version,
-                                  :to_pocket => "Release",
-                                  :include_binaries => true)
-            rescue => e
-                $logger.warn "failed to request copy, retry"
-                puts e
-                sleep 1
-                retry
-            end
-        end
-    end
-
-    def all_published?
-        return @published unless @published.nil?
-        each_source(:Published) do |source|
-            source_id = File.basename(source.self_link)
-            build_summary = @ppa.getBuildSummariesForSourceIds(:source_ids => source_id)
-            status = build_summary[source_id]['status']
-            return @published = false if status == 'FULLYBUILT_PENDING'
-        end
-        return @published = true
-    end
-
-    def each_source(statuses = %i(Pending Published Superseded Obsolete))
-        statuses = [statuses] unless statuses.is_a? Array
-        statuses.each do |status|
-            @ppa.getPublishedSources(status: status,
-                                     distro_series: @series).each do |source|
-                yield source
-            end
-        end
-    end
-end
-
-live = Archive.new("unstable", series)
-
-$logger.info "Working on unstable-daily"
-daily = Archive.new("stable-daily", series)
-# daily.wipe
-# daily.copy(live)
-
-$logger.info "Working on unstable-weekly"
-weekly = Archive.new("stable-weekly", series)
-# weekly.wipe
-weekly.copy(daily)
-
-sleep 60 while !daily.all_published? && !weekly.all_published?
-
-exit 0

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list