[SCM] ci-tooling packaging branch, master, updated. 72b18c2bfb72b8baa222ea565411d105a14d1a31
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Fri Nov 28 11:50:12 UTC 2014
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=72b18c2
The following commit has been merged in the master branch:
commit 72b18c2bfb72b8baa222ea565411d105a14d1a31
Author: Harald Sitter <sitter at kde.org>
Date: Fri Nov 28 12:49:57 2014 +0100
add a completely untested verbatim rewrite of ppa-wait in ruby
---
ppa-wait.rb | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 122 insertions(+)
diff --git a/ppa-wait.rb b/ppa-wait.rb
new file mode 100644
index 0000000..09be192
--- /dev/null
+++ b/ppa-wait.rb
@@ -0,0 +1,122 @@
+#!/usr/bin/env ruby
+
+require_relative 'lib/lp'
+
+Launchpad::authenticate!
+
+ppa = Launchpad::Rubber::from_url('/devel/~kubuntu-ci/+archive/ubuntu/')
+
+def print_state(source)
+ # FIXME: format strings
+ puts "#{source.distro_series.name}/#{source.source_package_name} (#{source.source_pakage_version}) #{source.status}"
+ build_logs = {}
+ anchor_file = File.open('_anchor-chain', 'w')
+ source.getBuilds().each do |build|
+ # FIXME: format strings
+ puts 'lallllll'
+ build_logs[build.arch_tag] = build.build_log_url
+ # FIXME
+ anchor_file.write(format_string)
+ end
+
+ build_log_marker = 'BUILD -'
+ build_logs.each do |arch|
+ log = build_logs[arch]
+ build_log_marker += " [#{arch}] (#{log})"
+ end
+ puts build_log_marker
+
+ source.getPublishedBinaries().each do |binary|
+ puts " #{binary.display_name} #{binary.status}"
+ end
+end
+
+def get_source
+ return ppa.getPublishedSources(:source_name => pkg_name,
+ :version => pkg_version)[0]
+end
+
+# If it takes 20 minutes for the source to arrive it probably got rejected.
+fail_count = 20 # This is ~= minutes
+while true
+ source = nil
+ begin
+ source = get_source()
+ rescue
+ sleep(60)
+ fail_count -= 1
+ if fail_count <= 0
+ puts 'Upload was likely rejected, we have been waiting for well over 20 minutes!'
+ exit 1
+ end
+ next
+ end
+
+ source.get_builds().each do |build|
+ state = build.buildstate
+ case state
+ when 'Needs building' || 'Currently building' || 'Uploading build' || 'Cancelling build'
+ needs_wait = true
+ sleep = 60 if sleep < 60
+ when 'Chroot problem' || 'Failed to upload'
+ puts 'retry'
+ needs_wait = true
+ build.retry!
+ sleep = (60*5) if sleep < (60*5)
+ when 'Failed to build' || 'Build for superseded Source' || 'Cancelled build' || 'Dependency wait'
+ has_failed = true
+ end
+
+ if has_failed
+ print_state(source)
+ exit 1
+ end
+ if needs_wait
+ sleep(sleep)
+ next
+ else
+ puts 'Builds look fine, moving on to publication checks'
+ break
+ end
+ end
+end
+
+while true
+ source = get_source
+ if source.status == 'Pending'
+ sleep(60*2)
+ next
+ end
+ puts 'Soure no longer pending...'
+ break
+end
+
+while true
+ has_pending = false
+ source = get_source()
+ source_id = File.basename(source.self_link)
+ build_summary = ppa.getBuildSummariesForSourceIds(:source_ids => source_id)
+ status = build_summary[source_id]['status']
+ case status
+ when 'FULLYBUILT_PENDING'
+ has_pending = true
+ when 'FULLYBUILT'
+ has_pending = false
+ else
+ puts "Something very terrible happened as the overall state is #{status}, which was not expected at all"
+ print_state(get_source())
+ exit 1
+ end
+ if not has_pending
+ puts 'All things are published, hooray!'
+ break
+ end
+ sleep(60)
+end
+
+source = get_source()
+print_state(source)
+get_logs(source)
+
+puts 'PPA Wait done.'
+exit 0
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list