def buildpackage(os_release=None, name=None, upload=True, ubuntu_release=None): """Build a package for the current repository.""" git.assert_in_repository() version = git_version() current_branch = git.current_branch() if os_release is None: os_release = parse_openstack_release(current_branch) deb_branch = discover_debian_branch(current_branch, version, os_release) with git.temporary_merge(deb_branch) as merge: source_package = dpkg_parsechangelog() current_version = source_package["Version"] version['debian'] = get_debian_commit_number() if ubuntu_release: dist = ubuntu_release else: dist = pbuilder.dist_from_release(os_release) dist_release = pbuilder.get_build_env(os_release, ubuntu_release) version['distribution'] = dist release_version = debian_version(current_version, version) local("dch -v {0} -D {1} --force-distribution 'Released'" .format(release_version, dist_release)) local("git add debian/changelog") local("git commit -m \"{0}\"".format("Updated Changelog")) git_buildpackage(current_branch, upstream_tree=merge.old_head, release=os_release, name=name, ubuntu_release=ubuntu_release) # Regenerate the source package information since it's changed # since we updated the changelog. source_package = dpkg_parsechangelog() changes = changes_filepath(source_package) if upload: execute(uploadpackage, changes)
def buildpackage(os_release=None, upload=True): """Build a package for the current repository.""" git.assert_in_repository() version = git_version() current_branch = git.current_branch() if os_release is None: os_release = parse_openstack_release(current_branch) deb_branch = discover_debian_branch(current_branch, version, os_release) with git.temporary_merge(deb_branch) as merge: source_package = dpkg_parsechangelog() current_version = source_package["Version"] version['debian'] = get_debian_commit_number() dist = dist_from_release(os_release) version['distribution'] = dist release_version = debian_version(current_version, version) local("dch -v {0} -D {1}-{2} --force-distribution 'Released'".format( release_version, dist, os_release)) local("git add debian/changelog") local("git commit -m \"{0}\"".format("Updated Changelog")) git_buildpackage(current_branch, upstream_tree=merge.old_head, release=os_release) # Regenerate the source package information since it's changed # since we updated the changelog. source_package = dpkg_parsechangelog() changes = changes_filepath(source_package) if upload: execute(uploadpackage, changes)
def push_without_review(project_name, branch): """Push the given git branch to a remote gerrit repo.""" git.assert_in_repository() user = gitreview_username() local( 'git push ssh://%[email protected]:29418/%s %s:refs/heads/%s' % (user, project_name, branch, branch))
def checkout_config(remote='origin'): """Checkout a projects configuration branch. """ git.assert_in_repository() local('git fetch %(remote)s ' 'refs/meta/config:refs/remotes/%(remote)s/meta/config' % {'remote': remote}) local('git checkout meta/config')
def checkout_config(remote='gerrit'): """Checkout a projects configuration branch. """ git.assert_in_repository() local('git fetch %(remote)s ' 'refs/meta/config:refs/remotes/%(remote)s/meta/config' % {'remote': remote}) local('git checkout meta/config')
def push_config(remote='origin'): """Push a projects configuration branch. """ git.assert_in_repository() local('git push %s meta/config:refs/meta/config' % remote)
def push_without_review(project_name, branch): """Push the given git branch to a remote gerrit repo.""" git.assert_in_repository() user = gitreview_username() local('git push ssh://%[email protected]:29418/%s %s:refs/heads/%s' % ( user, project_name, branch, branch))
def push_config(remote='gerrit'): """Push a projects configuration branch. """ git.assert_in_repository() local('git push %s meta/config:refs/meta/config' % remote)