Exemple #1
0
def upload_unstable():
    """
    Upload unstable version on the site
    """
    versions = os.path.join(PATH_TO_WINDOWS_DISTRIBS, OUTWIKER_VERSIONS_FILENAME)
    upload_files = map(lambda item: os.path.join(PATH_TO_WINDOWS_DISTRIBS, item),
                       FILES_FOR_UPLOAD_UNSTABLE_WIN)
    upload_files = upload_files + [versions]

    for fname in upload_files:
        print(u'Checking {}'.format(fname))
        assert os.path.exists(fname)

    print('Checking versions')
    newOutWikerAppInfo = readAppInfo(versions)
    print('Download {}'.format(newOutWikerAppInfo.updatesUrl))
    prevOutWikerAppInfo = downloadAppInfo(newOutWikerAppInfo.updatesUrl)

    if newOutWikerAppInfo.currentVersion < prevOutWikerAppInfo.currentVersion:
        print(Fore.RED + 'Error. New version < Prev version')
        sys.exit(1)
    elif newOutWikerAppInfo.currentVersion == prevOutWikerAppInfo.currentVersion:
        print (Fore.RED + 'Warning: Uploaded the same version')

    print ('Uploading...')
    for fname in upload_files:
        with cd(DEPLOY_UNSTABLE_PATH):
            basename = os.path.basename(fname)
            put(fname, basename)
Exemple #2
0
    def _build(self):
        # Path to archive with all plug-ins
        full_archive_path = self.get_plugins_pack_path()

        for plugin in self._plugins_list:
            # Path to versions.xml for current plugin
            xmlinfo_path = getPluginInfoPath(plugin)
            changelog_path = getPluginChangelogPath(plugin)

            localAppInfo = readAppInfo(xmlinfo_path)
            assert localAppInfo is not None
            assert localAppInfo.version is not None

            skip_plugin = False

            # Check for update
            if self._updatedOnly:
                url = localAppInfo.updatesUrl
                try:
                    siteappinfo = downloadAppInfo(url)
                    if localAppInfo.version == siteappinfo.version:
                        skip_plugin = True
                except (urllib.error.URLError, urllib.error.HTTPError):
                    pass

            # Archive a single plug-in
            if not skip_plugin:
                version = str(localAppInfo.version)
                archive_name = u'{}-{}.zip'.format(plugin, version)

                # Subpath to current plug-in archive
                plugin_dir_path = self._getSubpath(plugin)

                # Path to future archive
                archive_path = self._getSubpath(plugin, archive_name)
                os.mkdir(plugin_dir_path)
                shutil.copy(xmlinfo_path, plugin_dir_path)
                shutil.copy(changelog_path, plugin_dir_path)

                # Archive a single plug-in
                with lcd("plugins/{}".format(plugin)):
                    local(
                        '7z a -r -aoa -xr!*.pyc -xr!.ropeproject -x!doc -x!versions.xml "{}" ./*'
                        .format(archive_path))

            # Add a plug-in to full archive
            with lcd("plugins/{}".format(plugin)):
                local(
                    '7z a -r -aoa -xr!*.pyc -xr!.ropeproject -x!versions.xml -w../ "{}" ./*'
                    .format(full_archive_path))
Exemple #3
0
    def _build(self):
        # Path to archive with all plug-ins
        full_archive_path = self._getSubpath(self._all_plugins_fname)

        for plugin in self._plugins_list:
            # Path to plugin.xml for current plugin
            xmlplugin_path = getPluginVersionsPath(plugin)

            localAppInfo = readAppInfo(xmlplugin_path)
            assert localAppInfo is not None
            assert localAppInfo.currentVersion is not None

            skip_plugin = False

            # Check for update
            if self._updatedOnly:
                url = localAppInfo.updatesUrl
                try:
                    siteappinfo = downloadAppInfo(url)
                    if localAppInfo.currentVersion == siteappinfo.currentVersion:
                        skip_plugin = True
                except (urllib2.URLError, urllib2.HTTPError):
                    pass

            # Archive a single plug-in
            if not skip_plugin:
                version = unicode(localAppInfo.currentVersion)
                archive_name = u'{}-{}.zip'.format(plugin, version)

                # Subpath to current plug-in archive
                plugin_dir_path = self._getSubpath(plugin)

                # Path to future archive
                archive_path = self._getSubpath(plugin, archive_name)
                os.mkdir(plugin_dir_path)
                shutil.copy(xmlplugin_path, plugin_dir_path)

                # Archive a single plug-in
                with lcd("plugins/{}".format(plugin)):
                    local("7z a -r -aoa -xr!*.pyc -xr!.ropeproject ../../{} ./*".format(archive_path))

            # Add a plug-in to full archive
            with lcd("plugins/{}".format(plugin)):
                local("7z a -r -aoa -xr!*.pyc -xr!.ropeproject -w../ ../../{} ./*".format(full_archive_path))