Example #1
0
        branch_location = ['lp:', bzr_staging, '~', launchpad.me.name, '/', project.name, '/quickly_trunk']
    return_code = packaging.filter_exec_command(["bzr", "push", "--remember", "--overwrite", "".join(branch_location)])
    if return_code != 0:
        print _("ERROR: quickly can't release: can't push to launchpad.")
        sys.exit(return_code)

    # make first pull too
    return_code = packaging.filter_exec_command(["bzr", "pull", "--remember", "".join(branch_location)])
    if return_code != 0:
        print _("ERROR: quickly can't release correctly: can't pull from launchpad.")
        sys.exit(return_code)


# upload to launchpad
print _("pushing to launchpad")
return_code = packaging.push_to_ppa(dput_ppa_name, "../%s_%s_source.changes" % (project_name, release_version), keyid=keyid) != 0
if return_code != 0:
    sys.exit(return_code)

#create new release_date
launchpad_helper.push_tarball_to_launchpad(project, release_version,
                                    "../%s_%s.tar.gz" % (project_name,
                                    release_version), changelog)

print _("%s %s released and submitted to ubuntu. Wait for half an hour and have look at %s.") % (project_name, release_version, ppa_url)
print _("Then your application will be reviewed by the application review board.")

# as launchpad-open doesn't support staging server, put an url
if launchpadaccess.lp_server == "staging":
    webbrowser.open(launchpadaccess.LAUNCHPAD_CODE_STAGING_URL + '/' + project.name)
else:
        print _("ERROR: quickly can't release: can't push to launchpad.")
        sys.exit(return_code)

    # make first pull too
    return_code = packaging.filter_exec_command(
        ["bzr", "pull", "--remember", "".join(branch_location)])
    if return_code != 0:
        print _(
            "ERROR: quickly can't release correctly: can't pull from launchpad."
        )
        sys.exit(return_code)

# upload to launchpad
print _("pushing to launchpad")
return_code = packaging.push_to_ppa(dput_ppa_name,
                                    "../%s_%s_source.changes" %
                                    (project_name, release_version),
                                    keyid=keyid) != 0
if return_code != 0:
    sys.exit(return_code)

#create new release_date
launchpad_helper.push_tarball_to_launchpad(
    project, release_version,
    "../%s_%s.tar.gz" % (project_name, release_version), changelog)

print _(
    "%s %s released and submitted to ubuntu. Wait for half an hour and have look at %s."
) % (project_name, release_version, ppa_url)
print _(
    "Then your application will be reviewed by the application review board.")