new_version = curr_version + options.version_suffix
reprepro_base = '/srv/pb-{dist}'.format(dist=curr_dist)
apt_target = "repo01-debian"
+ additional_repos = []
# replace valid debian version chars that are invalid for git tagging
new_tag = curr_version.replace('~', '_').replace(':', ',')
new_version = version_substitution(logger, pattern, curr_commit)
reprepro_base = '/srv/pb-{dist}'.format(dist=curr_dist)
apt_target = "repo01-debian-dev"
+ additional_repos = [
+ "deb http://repo.pb.local/pb-debian-dev {dist} main non-free contrib".format(
+ dist=new_dist
+ )
+ ]
# reset actions
# .. always include successful build packages into CIDB
if curr_dist == 'squeeze':
new_version = version_substitution(logger, pattern, curr_commit)
reprepro_base = '/srv/dev-{dist}'.format(dist=curr_dist)
apt_target = "repo01-debian-dev"
+ additional_repos = [
+ "deb http://repo.pb.local/pb-debian-dev {dist} main non-free contrib".format(
+ dist=curr_dist+'-dev'
+ ),
+ ]
+ release_file = "http://repo.pb.local/pb-debian-dev/dists/" + new_dist + "/Release"
+ check_cmd = ['wget', '-q', '--spider', release_file]
+ if subprocess.call(check_cmd) == 0:
+ logger.info('Distribution {dist} found in http://repo.pb.local/pb-debian-dev'
+ .format(dist=new_dist))
+ additional_repos.append("deb http://repo.pb.local/pb-debian-dev "
+ "{dist} main non-free contrib".format(dist=new_dist))
+ else:
+ logger.info('Distribution {dist} not found in http://repo.pb.local/pb-debian-dev'
+ .format(dist=new_dist))
else:
logger.error('Don\'t know how to handle branch "{branch}".'.format(
dsc_file=source_builder.dsc_file,
dist=new_dist,
chroot='pb-'+curr_dist,
- arch='amd64'
+ arch='amd64',
+ additional_repos=additional_repos,
)
if ret == 0:
logger.info('Current environment:\n\n{env}\n'.format(env=builder.env))
###
'''.format(hostname=socket.gethostname(),
jenkins_user=ENV['USER'],
- jenkins_workspace=ENV['WORKSPACE'],
+ jenkins_workspace=builder.dsc_dir,
builder_env=' '.join(['{k}="{v}"'.format(k=key, v=builder.env[key],)
for key in builder.env.keys()]),
command=' '.join(builder.command),
class Sbuild(object):
- def __init__(self, dsc_file=None, dist=None, chroot=None, arch=None):
+ def __init__(self, dsc_file=None, dist=None, chroot=None, arch=None, additional_repos=None):
'''
TODO
'''
self.arch = arch
self.chroot = chroot
self.dist = dist
+ self.additional_repos = additional_repos
@property
def env(self):
'-n',
'--arch=' + self.arch,
'-d', self.dist,
- '-c', self.chroot,
- self.dsc_file,
- ]
+ '-c', self.chroot
+ ] + ['--extra-repository="' + repo + '"' for repo in self.additional_repos] + \
+ [self.dsc_file]
return result
@property