[SCM] ci-tooling packaging branch, master, updated. 1625c72d11ed469f99cf5787b0c997fed1bba0fc
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Fri Apr 10 09:53:21 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=1625c72
The following commit has been merged in the master branch:
commit 1625c72d11ed469f99cf5787b0c997fed1bba0fc
Author: Harald Sitter <sitter at kde.org>
Date: Fri Apr 10 11:52:24 2015 +0200
drop daily-qa, replaced by slew of other tools
---
kci/daily-qa.rb | 281 --------------------------------------------------------
1 file changed, 281 deletions(-)
diff --git a/kci/daily-qa.rb b/kci/daily-qa.rb
deleted file mode 100755
index 6904d43..0000000
--- a/kci/daily-qa.rb
+++ /dev/null
@@ -1,281 +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 'logger'
-require 'logger/colors'
-
-require_relative 'lib/jenkins'
-require_relative 'lib/lp'
-require_relative 'lib/retry'
-require_relative 'lib/thread_pool'
-
-$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
- status = jenkins.job.status(name)
- in_queue = jenkins.queue.list.include?(name)
- $logger.info "#{name} :: #{status} :: #{in_queue}"
- if (status != 'success' && status != 'unstable') || in_queue
- $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 ppa:kubuntu-ci/#{@type}")
- system('apt-get update')
- @added = false
- end
-
- def packages
- return @packages unless @packages.empty?
-
- logger = $logger
- logger.info "Building package list for PPA #{@type}."
-
- series = Launchpad::Rubber.from_url("https://api.launchpad.net/devel/ubuntu/#{@series}")
- # FIXME: arch hardcode
- reference_distro_arch_series_link =
- Launchpad::Rubber.from_url("#{series.self_link}/amd64").self_link
- ppa = Launchpad::Rubber.from_url("https://api.launchpad.net/devel/~kubuntu-ci/+archive/ubuntu/#{@type}")
-
- packages = {}
-
- sources = ppa.getPublishedSources(status: 'Published',
- distro_series: series)
- source_queue = Queue.new
- sources.each { |s| source_queue << s }
- binary_queue = Queue.new
- BlockingThreadPool.run(8) do
- until source_queue.empty?
- source = source_queue.pop(true)
- Retry.retry_it do
- binary_queue << source.getPublishedBinaries
- end
- end
- end
-
- until binary_queue.empty?
- binaries = binary_queue.pop(true)
- binaries.each do |binary|
- logger.info "#{binary.binary_package_name} || #{binary.architecture_specific}|| #{binary.distro_arch_series_link}"
- # Do not include debug packages, they can't conflict anyway, and if
- # they did we still wouldn't care.
- next if binary.binary_package_name.end_with?('-dbg')
- # Do not include known to conflict packages
- next if binary.binary_package_name == 'libqca2-dev'
- # Do not include udebs, this unfortunately cannot be determined
- # easily via the API.
- next if binary.binary_package_name.start_with?('oem-config')
- # Unresolvable as that requires more PPAs...
- next if binary.binary_package_name == 'kubuntu-ci-live'
- next if binary.binary_package_name == 'kubuntu-plasma5-desktop'
- if binary.architecture_specific
- unless binary.distro_arch_series_link == reference_distro_arch_series_link
- logger.info ' skipping unsuitable arch'
- end
- end
- packages[binary.binary_package_name] = binary.binary_package_version
- end
- end
-
- logger.info "Built package list: #{packages.keys.join(', ')}"
- @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
-
-# Disable invoke-rc.d because it is crap
-system("echo '#!/bin/sh' > /usr/sbin/invoke-rc.d")
-# Because dependencies are fucked
-# [14:27] <sitter> dictionaries-common is a crap package
-# [14:27] <sitter> it suggests a wordlist but doesn't pre-depend them or
-# anything, intead it just craps out if a wordlist provider is installed but
-# there is no wordlist -.-
-system('apt-get install wamerican')
-
-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 == project.series
- series = _series
- break
-end
-
-class Archive
- attr_accessor :ppa
-
- def initialize(name, series)
- @ppa = Launchpad::Rubber::from_url("https://api.launchpad.net/devel/~kubuntu-ci/+archive/ubuntu/#{name}")
- @series = series
- end
-
- def wipe
- # We need to iter clear as Deleted entries would still retain their entry
- # making the unfiltered list grow larger and larger every time.
- %i(Pending Published Superseded Obsolete).each do |status|
- @ppa.getPublishedSources(:status => status,
- :distro_series => @series).each do |source|
- next if source.status == "Deleted"
- $logger.info "Requesting deletion of: #{source.source_package_name} from #{@name}"
- begin
-p source.requestDeletion!()
- rescue => e
- $logger.warn "failed to request deletion, retry"
- puts e
- sleep 1
- retry
- end
- end
- end
- end
-
- def copy(from_ppa)
- from_ppa.getPublishedSources(:status => "Published",
- :distro_series => @series.self_link).each do |source|
- $logger.info "Copying source: #{source.source_package_name} (#{source.source_package_version})"
- begin
- @ppa.copyPackage!(:from_archive => from_ppa.self_link,
- :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
-end
-
-live = Archive.new(project.stability, series)
-
-$logger.info "Working on #{project.stability}-daily"
-daily = Archive.new("#{project.stability}-daily", series)
-daily.wipe
-daily.copy(live.ppa)
-
-# $logger.info "Working on unstable-weekly"
-# weekly = Archive.new("unstable-weekly", series)
-# weekly.wipe
-# weekly.copy(live.ppa)
-
-exit 0
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list