return parser.parse_args()
+
+def upload_to_archive01(archive01_target, archive01_dist, changes_file, logger):
+ try:
+ # dpkg-genchanges -b -DDistribution=$dist > $changes_file
+ cmd = ['dpkg-genchanges', '-b', '-DDistribution=' + archive01_dist]
+ logger.debug('Executing "{command}" ...'.format(command=' '.join(cmd)))
+ process = subprocess.Popen(cmd, close_fds=True, stdout=subprocess.PIPE, cwd=os.getcwd())
+ changes = process.communicate()[0]
+
+ filehandler = open(changes_file, 'w')
+ filehandler.write(changes)
+ filehandler.close()
+
+ cmd = ['dput', archive01_target, changes_file]
+ command = ' '.join(cmd)
+ logger.debug('Executing "{command}" ...'.format(command=command))
+ if subprocess.call(cmd) == 0:
+ logger.debug('%s succeeded.' % command)
+ else:
+ logger.warn('%s failed.' % command)
+ except Exception as error:
+ logger.warning("Experimental upload to http://archive01.pb.local failed. "
+ "See above for details.", exc_info=error)
+
+
if __name__ == '__main__':
logger.debug('Start-up environment:\n\n{env}\n'.format(env=pformat(ENV)))
new_version = curr_version + options.version_suffix
pb_suite = 'master-{dist}'.format(dist=curr_dist)
reprepro_base = '/srv/pb-{dist}'.format(dist=curr_dist)
+ archive01_dist = curr_dist
+ archive01_target = "archive01-debian"
# replace valid debian version chars that are invalid for git tagging
new_tag = curr_version.replace('~', '_').replace(':', ',')
)
pb_suite = 'develop-{dist}'.format(dist=curr_dist)
reprepro_base = '/srv/pb-{dist}'.format(dist=curr_dist)
+ archive01_dist = curr_dist + '-dev'
+ archive01_target = "archive01-debian"
# reset actions
# .. always include successful build packages into CIDB
if curr_dist == 'squeeze':
suffix=options.version_suffix,
)
reprepro_base = '/srv/dev-{dist}'.format(dist=curr_dist)
+ archive01_dist = curr_dist + "-" + local_branch.replace("/", "-")
+ archive01_target = "archive01-debian-dev"
else:
logger.error('Don\'t know how to handle branch "{branch}".'.format(
figlet('Upload OK')
+ upload_to_archive01(archive01_target, archive01_dist, changes_file, logger)
+
except Exception as error:
logger.error('Upload failed. See above for details.', exc_info=error)
figlet('Upload failed')