[SCM] ci-tooling packaging branch, master, updated. 1057b74bf91a718f36ab197ae6eabb076ed20b90
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Tue Oct 6 11:56:13 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=1057b74
The following commit has been merged in the master branch:
commit 1057b74bf91a718f36ab197ae6eabb076ed20b90
Author: Harald Sitter <sitter at kde.org>
Date: Tue Oct 6 13:56:03 2015 +0200
refactor kcibuilder to contain build_and_publish into a method
we will eventually be able to test this independently and tear apart
the entire builder
---
kci/builder.rb | 83 ++++++++++++++++++++++++++++++----------------------------
1 file changed, 43 insertions(+), 40 deletions(-)
diff --git a/kci/builder.rb b/kci/builder.rb
index aee8b3d..8d91d5f 100755
--- a/kci/builder.rb
+++ b/kci/builder.rb
@@ -53,6 +53,48 @@ class KCIBuilder
@testing ||= false
end
+ def self.build_and_publish(source)
+ Dir.chdir('build') do
+ # Upload likes to get stuck, so we do timeout control to prevent all of
+ # builder from getting stuck.
+ # We try to dput two times in a row giving it first 30 minutes and then
+ # 15 minutes to complete. If it didn't manage to upload after that we
+ # ignore the package and move on.
+ `cp -rf /var/lib/jenkins/.ssh /root/`
+ `chown -Rv root:root /root/.ssh`
+ if `ssh-keygen -F ppa.launchpad.net`.strip.empty?
+ `ssh-keyscan -H ppa.launchpad.net >> ~/.ssh/known_hosts`
+ end
+ dput = "dput -d -c #{DPUTCONF} #{@ppa} #{source.name}_#{source.build_version.tar}*.changes"
+ success = false
+ 4.times do |count|
+ # Note: count starts at 0 ;)
+ if timeout_spawn(dput, 60 * (30.0 / (count + 1)))
+ puts "spawn timeout goody"
+ success = true
+ break
+ end
+ puts "spawn timout badly"
+ sleep(60) # Sleep for a minute
+ end
+ abort ' !!!!!!!!!!!! dput failed two times !!!!!!!!!!!!' unless success
+ Dir.chdir('..') do # main dir
+ puts "before require"
+ require_relative 'source_publisher'
+ puts "after require; before new"
+ publisher = SourcePublisher.new(source.name, source.version, project.stability)
+ puts "after new"
+ abort 'PPA Build Failed' unless publisher.wait
+ # Write upload data to file, we perhaps want to do something outside the
+ # build container.
+ data = { name: source.name,
+ version: source.version,
+ type: project.stability }
+ File.write('source.json', JSON.generate(data))
+ end
+ end
+ end
+
def self.run
ENV['GNUPGHOME'] = '/var/lib/jenkins/tooling/gnupg'
@@ -115,46 +157,7 @@ class KCIBuilder
end
end
- Dir.chdir('build/source/') do
- changelog = Changelog.new
- # Upload likes to get stuck, so we do timeout control to prevent all of
- # builder from getting stuck.
- # We try to dput two times in a row giving it first 30 minutes and then
- # 15 minutes to complete. If it didn't manage to upload after that we
- # ignore the package and move on.
- `cp -rf /var/lib/jenkins/.ssh /root/`
- `chown -Rv root:root /root/.ssh`
- if `ssh-keygen -F ppa.launchpad.net`.strip.empty?
- `ssh-keyscan -H ppa.launchpad.net >> ~/.ssh/known_hosts`
- end
- dput = "dput -d -c #{DPUTCONF} #{@ppa} ../#{changelog.name}_#{changelog.version(Changelog::BASE | Changelog::BASESUFFIX)}*.changes"
- success = false
- 4.times do |count|
- # Note: count starts at 0 ;)
- if timeout_spawn(dput, 60 * (30.0 / (count + 1)))
- puts "spawn timeout goody"
- success = true
- break
- end
- puts "spawn timout badly"
- sleep(60) # Sleep for a minute
- end
- abort ' !!!!!!!!!!!! dput failed two times !!!!!!!!!!!!' unless success
- Dir.chdir('../..') do # main dir
- puts "before require"
- require_relative 'source_publisher'
- puts "after require; before new"
- publisher = SourcePublisher.new(changelog.name, changelog.version, project.stability)
- puts "after new"
- abort 'PPA Build Failed' unless publisher.wait
- # Write upload data to file, we perhaps want to do something outside the
- # build container.
- data = { name: changelog.name,
- version: changelog.version,
- type: project.stability }
- File.write('source.json', JSON.generate(data))
- end
- end
+ build_and_publish(source)
unless File.exist?('logs/i386.log')
puts "found no logs"
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list