Ejemplo n.º 1
0
    def build_package(self, platform, arch_bit, op_id, branding_options,
                      package_types, destination, routing_key):
        buid_request = build.BuildRequest(platform, arch_bit)
        platform = buid_request.platform()
        arch = platform.arch()

        platform_and_arch_str = '{0}_{1}'.format(platform.name(), arch.name())
        dir_name = 'build_{0}_for_{1}'.format(platform_and_arch_str, op_id)
        bs = build.get_supported_build_system_by_name('ninja')

        self.send_status(routing_key, op_id, 20.0, 'Building package')

        def store(progress_min, progress_max, routing_key, op_id):
            def closure(progress, message):
                diff = progress_max - progress_min
                perc = round(progress_min + diff * (progress / 100.0), 1)
                print('{0}% {1}'.format(perc, message))
                sys.stdout.flush()
                self.send_status(routing_key, op_id, perc, message)

            return closure

        store = store(21.0, 79.0, routing_key, op_id)

        saver = build.ProgressSaver(store)
        file_paths = buid_request.build('..', branding_options, dir_name, bs,
                                        package_types, saver)
        file_path = file_paths[0]
        self.send_status(routing_key, op_id, 80.0, 'Loading package to server')
        try:
            result = config.post_install_step(file_path, destination)
        except Exception as ex:
            raise ex

        return result
Ejemplo n.º 2
0
        arch_bit_str = sys.argv[3]
    else:
        arch_bit_str = system_info.get_arch_name()

    if argc > 4:
        bs_str = sys.argv[4]
        bs = system_info.get_supported_build_system_by_name(bs_str)
    else:
        bs = None

    if argc > 5:
        packages = sys.argv[5].split()
    else:
        packages = []

    request = build.BuildRequest(platform_str, arch_bit_str)
    saver = build.ProgressSaver(print_message)

    # fastonosql build
    fastonosql_branding_file = os.path.abspath('fastonosql.txt')
    fastonosql_branding_options = utils.read_file_line_by_line_to_list(
        fastonosql_branding_file)
    #    request.build(cmake_root, fastonosql_branding_options, 'build_fastonosql_' + platform_str, bs,
    #                  packages, saver)

    # pro version
    fastonosql_branding_options.append('-DPRO_VERSION=ON')
    fastonosql_branding_options.append('-DBUILD_STRATEGY:STRING=community')
    request.build(cmake_root, fastonosql_branding_options,
                  'build_fastonosql_pro_' + platform_str, bs, packages, saver)