[SCM] ci-tooling packaging branch, master, updated. 35fd4e418d460d2a9d5921981a6ec9654926b74f

Harald Sitter apachelogger-guest at moszumanska.debian.org
Fri Jun 12 08:02:54 UTC 2015


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

The following commit has been merged in the master branch:
commit 35fd4e418d460d2a9d5921981a6ec9654926b74f
Author: Harald Sitter <sitter at kde.org>
Date:   Fri Jun 12 01:02:46 2015 -0700

    add a simpe binary builder
---
 kci/binarier.rb | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/kci/binarier.rb b/kci/binarier.rb
new file mode 100644
index 0000000..dc82133
--- /dev/null
+++ b/kci/binarier.rb
@@ -0,0 +1,65 @@
+#!/usr/bin/env ruby
+
+require 'date'
+require 'fileutils'
+require 'json'
+require 'timeout'
+
+require_relative 'lib/apt'
+
+ENV['HOME'] = '/var/lib/jenkins'
+
+Project = Struct.new(:series, :stability, :name)
+
+$stdout = $stderr
+
+# get basename, distro series, unstable/stable
+p ARGV
+components = ARGV[0].split('_')
+p components
+unless components.size == 2
+  abort 'Did not get a valid project identifier via ARGV0'
+end
+project = Project.new('vivid', 'unstable', components[0])
+
+# PWD
+abort 'Could not change dir to ARGV1' unless Dir.chdir(ARGV[1])
+
+WORKSPACE_PATH = ARGV[1]
+
+# Workaround for docker not having suidmaps. We run as root in the docker
+# which will result in uid/gid of written things to be 0 rather than whatever
+# jenkins has. So instead we have a fake jenkins user in the docker we can
+# chmod to. This ultimately ensures that the owernship is using the uid of
+# the host jenkins (equal to docker jenkins) such that we don't end up with
+# stuff owned by others.
+at_exit do
+  FileUtils.chown_R('jenkins', 'jenkins', WORKSPACE_PATH, verbose: true)
+end
+
+dscs = Dir.glob('build/*.dsc')
+if dscs.size > 1
+  fail "Too many dscs #{dscs}"
+elsif dirs.size < 1
+  fail "Too few dscs #{dscs}"
+end
+dsc = dscs[0]
+
+system('dpkg-source', '-x', dsc, 'build/')
+dirs = Dir.glob('*').select { |f| File.directory?(f) }
+if dirs.size > 1
+  fail "Too many dirs #{dirs}"
+elsif dirs.size < 1
+  fail "Too few dirs #{dirs}"
+end
+dir = dirs[0]
+
+Dir.chdir(dir) do
+  Apt.install('pbuilder')
+  system('/usr/lib/pbuilder/pbuilder-satisfydepends')
+  system('dpkg-buildpackage', '-us', '-uc', '-b')
+end
+
+debs = Dir.glob('build/*.deb')
+Dir.mkdir('result/')
+FileUtils.cp(debs, 'result/')

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list