Exemplo n.º 1
0
def deploy(is_stable=False):
    '''
    Upload to site
    '''
    if is_stable:
        deploy(False)
    else:
        # To upload only once
        upload_plugin()
        upload_plugins_pack()

    # ppa_path = PPA_STABLE_PATH if is_stable else PPA_UNSTABLE_PATH
    #
    # deb_path = BuilderDebSourcesIncluded(DEB_SOURCE_BUILD_DIR,
    #                                      UBUNTU_RELEASE_NAMES,
    #                                      tobool(is_stable)).getResultPath()
    # _ppa_upload(ppa_path, deb_path)

    upload_binary(is_stable)

    version_str = getOutwikerVersionStr()
    if is_stable:
        tagname = u'release_{}'.format(version_str)
    else:
        tagname = u'unstable_{}'.format(version_str)

    _add_git_tag(tagname)
Exemplo n.º 2
0
def deploy(is_stable=False):
    '''
    Upload to site
    '''
    if is_stable:
        deploy(False)
    else:
        # To upload only once
        upload_plugin()
        upload_plugins_pack()

    # ppa_path = PPA_STABLE_PATH if is_stable else PPA_UNSTABLE_PATH
    #
    # deb_path = BuilderDebSourcesIncluded(DEB_SOURCE_BUILD_DIR,
    #                                      UBUNTU_RELEASE_NAMES,
    #                                      tobool(is_stable)).getResultPath()
    # _ppa_upload(ppa_path, deb_path)

    upload_binary(is_stable)

    version_str = getOutwikerVersionStr()
    if is_stable:
        tagname = u'release_{}'.format(version_str)
    else:
        tagname = u'unstable_{}'.format(version_str)

    _add_git_tag(tagname)
Exemplo n.º 3
0
def upload_plugins(*plugins_list):
    '''
    Upload plugin to site
    '''
    if len(plugins_list) == 0:
        plugins_list = PLUGINS_LIST

    version_str = getOutwikerVersionStr()
    build_plugins_dir = os.path.join(BUILD_DIR, version_str, PLUGINS_DIR)
    uploader = PluginsUploader(build_plugins_dir, DEPLOY_HOME_PATH)

    print_info('Uploading plug-ins to {}...'.format(DEPLOY_SERVER_NAME))
    uploader.upload(plugins_list)
Exemplo n.º 4
0
def upload_plugin(*args):
    '''
    Upload plugin to site
    '''
    if len(args) == 0:
        args = PLUGINS_LIST

    version_str = getOutwikerVersionStr()

    for pluginname in args:
        path_to_plugin_local = os.path.join(BUILD_DIR, version_str,
                                            PLUGINS_DIR, pluginname)

        if not os.path.exists(path_to_plugin_local):
            continue

        path_to_xml_local = os.path.join(path_to_plugin_local,
                                         PLUGIN_VERSIONS_FILENAME)

        xml_content_local = readTextFile(path_to_xml_local)
        appinfo_local = XmlVersionParser().parse(xml_content_local)

        url = appinfo_local.updatesUrl
        try:
            appinfo_remote = downloadAppInfo(url)
        except Exception:
            appinfo_remote = None

        if (appinfo_remote is not None and
                appinfo_local.currentVersion < appinfo_remote.currentVersion):
            print_error(u'Error. New version < Prev version')
            sys.exit(1)
        elif (appinfo_remote is not None and appinfo_local.currentVersion
              == appinfo_remote.currentVersion):
            print_warning(u'Warning: Uploaded the same version')
        print_info(u'Uploading...')

        path_to_upload = os.path.dirname(
            appinfo_local.updatesUrl.replace(DEPLOY_SITE + u'/',
                                             DEPLOY_HOME_PATH))
        version_local = str(appinfo_local.currentVersion)
        archive_name = u'{}-{}.zip'.format(pluginname, version_local)
        path_to_archive_local = os.path.join(path_to_plugin_local,
                                             archive_name)

        with cd(path_to_upload):
            put(path_to_archive_local, archive_name)
            put(path_to_xml_local, PLUGIN_VERSIONS_FILENAME)
    site_versions()
Exemplo n.º 5
0
    def __init__(self):
        # x.x.x.xxx
        self.version = getOutwikerVersionStr()

        # Version tuple ('x.x.x', 'xxx')
        self.version_items = getOutwikerVersion()

        # build/
        self.root_dir = os.path.abspath(defines.BUILD_DIR)

        # build/x.x.x.xxx/
        self.version_dir = os.path.join(self.root_dir, self.version)

        # build/x.x.x.xxx/windows/
        self.build_dir_windows = os.path.join(self.version_dir,
                                              defines.WINDOWS_BUILD_DIR)

        # build/x.x.x.xxx/linux/
        self.build_dir_linux = os.path.join(self.version_dir,
                                            defines.LINUX_BUILD_DIR)

        # build/x.x.x.xxx/versions.xml
        self.versions_file = os.path.join(self.version_dir,
                                          defines.OUTWIKER_VERSIONS_FILENAME)

        # build/tmp/
        self.temp_dir = os.path.join(self.root_dir, u'tmp')

        # need_for_build/
        self.need_for_build = os.path.abspath(defines.NEED_FOR_BUILD_DIR)

        # need_for_build/windows
        self.nfb_win = os.path.join(self.need_for_build, u'windows')

        # need_for_build/linux
        self.nfb_linux = os.path.join(self.need_for_build, u'linux')

        # need_for_build/virtual
        self.nfb_virtual = os.path.join(self.need_for_build, u'virtual')

        # need_for_build/snap
        self.nfb_snap = os.path.join(self.need_for_build, u'snap')

        # need_for_build/linux
        self.nfb_linux = os.path.join(self.need_for_build, u'linux')

        # Source plugins dir
        self.src_plugins_dir = os.path.abspath(defines.PLUGINS_DIR)
Exemplo n.º 6
0
def upload_plugin(*args):
    '''
    Upload plugin to site
    '''
    if len(args) == 0:
        args = PLUGINS_LIST

    version_str = getOutwikerVersionStr()

    for pluginname in args:
        path_to_plugin_local = os.path.join(BUILD_DIR,
                                            version_str,
                                            PLUGINS_DIR,
                                            pluginname)

        if not os.path.exists(path_to_plugin_local):
            continue

        path_to_xml_local = os.path.join(path_to_plugin_local,
                                         PLUGIN_VERSIONS_FILENAME)

        xml_content_local = readTextFile(path_to_xml_local)
        appinfo_local = XmlVersionParser().parse(xml_content_local)

        url = appinfo_local.updatesUrl
        try:
            appinfo_remote = downloadAppInfo(url)
        except Exception:
            appinfo_remote = None

        if (appinfo_remote is not None and
                appinfo_local.currentVersion < appinfo_remote.currentVersion):
            print_error(u'Error. New version < Prev version')
            sys.exit(1)
        elif (appinfo_remote is not None and
                appinfo_local.currentVersion == appinfo_remote.currentVersion):
            print_warning(u'Warning: Uploaded the same version')
        print_info(u'Uploading...')

        path_to_upload = os.path.dirname(appinfo_local.updatesUrl.replace(DEPLOY_SITE + u'/', DEPLOY_HOME_PATH))
        version_local = str(appinfo_local.currentVersion)
        archive_name = u'{}-{}.zip'.format(pluginname, version_local)
        path_to_archive_local = os.path.join(path_to_plugin_local, archive_name)

        with cd(path_to_upload):
            put(path_to_archive_local, archive_name)
            put(path_to_xml_local, PLUGIN_VERSIONS_FILENAME)
    site_versions()
Exemplo n.º 7
0
def add_sources_tag(apply=False, is_stable=False):
    '''
    Add the tag to git repository and push
    '''
    version_str = getOutwikerVersionStr()
    if is_stable:
        tagname = u'release_{}'.format(version_str)
    else:
        tagname = u'unstable_{}'.format(version_str)

    commands = [
        'git checkout master',
        'git tag {}'.format(tagname),
        'git push --tags',
    ]
    _run_commands(commands, apply)
Exemplo n.º 8
0
    def __init__(self):
        # x.x.x.xxx
        self.version = getOutwikerVersionStr()

        # Version tuple ('x.x.x', 'xxx')
        self.version_items = getOutwikerVersion()

        # build/
        self.root_dir = os.path.abspath(defines.BUILD_DIR)

        # build/x.x.x.xxx/
        self.version_dir = os.path.join(self.root_dir, self.version)

        # build/x.x.x.xxx/windows/
        self.build_dir_windows = os.path.join(self.version_dir,
                                              defines.WINDOWS_BUILD_DIR)

        # build/x.x.x.xxx/linux/
        self.build_dir_linux = os.path.join(self.version_dir,
                                            defines.LINUX_BUILD_DIR)

        # build/x.x.x.xxx/versions.xml
        self.versions_file = os.path.join(self.version_dir,
                                          defines.OUTWIKER_VERSIONS_FILENAME)

        # build/tmp/
        self.temp_dir = os.path.join(self.root_dir, u'tmp')

        # need_for_build/
        self.need_for_build = os.path.abspath(defines.NEED_FOR_BUILD_DIR)

        # need_for_build/windows
        self.nfb_win = os.path.join(self.need_for_build, u'windows')

        # need_for_build/linux
        self.nfb_linux = os.path.join(self.need_for_build, u'linux')

        # need_for_build/virtual
        self.nfb_virtual = os.path.join(self.need_for_build, u'virtual')

        # need_for_build/snap
        self.nfb_snap = os.path.join(self.need_for_build, u'snap')

        # Source plugins dir
        self.src_plugins_dir = os.path.abspath(defines.PLUGINS_DIR)
Exemplo n.º 9
0
def vm_linux_binary(is_stable=0):
    '''
    Create 64-bit assembly on virtual machines
    '''
    vm_run()
    version_str = getOutwikerVersionStr()
    version = getOutwikerVersion()

    path_to_result = os.path.abspath(
        os.path.join(BUILD_DIR, version_str, LINUX_BUILD_DIR))

    if not os.path.exists(path_to_result):
        os.makedirs(path_to_result)

    with lcd(u'need_for_build/virtual/build_machines'):
        local(
            u'ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook build_linux_binaries.yml --extra-vars "version={version} build={build} save_to={save_to} is_stable={is_stable}"'
            .format(version=version[0],
                    build=version[1],
                    save_to=path_to_result,
                    is_stable=is_stable))
Exemplo n.º 10
0
def vm_linux_binary(is_stable=0):
    '''
    Create 64-bit assembly on virtual machines
    '''
    vm_run()
    version_str = getOutwikerVersionStr()
    version = getOutwikerVersion()

    path_to_result = os.path.abspath(
        os.path.join(BUILD_DIR, version_str, LINUX_BUILD_DIR)
    )

    if not os.path.exists(path_to_result):
        os.makedirs(path_to_result)

    with lcd(u'need_for_build/virtual/build_machines'):
        local(u'ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook build_linux_binaries.yml --extra-vars "version={version} build={build} save_to={save_to} is_stable={is_stable}"'.format(
            version=version[0],
            build=version[1],
            save_to=path_to_result,
            is_stable=is_stable)
        )