Example #1
0
def assets(args):
    c = fetch_config(args)

    with BuildApp.context(c) as app:
        if c.runstate.clean_generated is True:
            assets_clean(c, app)
        else:
            assets_tasks(c, app)
Example #2
0
def assets(args):
    c = fetch_config(args)
    app = BuildApp(c)

    if c.runstate.clean_generated is True:
        assets_clean(c, app)
    else:
        assets_tasks(c, app)

    app.run()
Example #3
0
def build_prep_tasks(conf, app):
    image_tasks(conf, app)
    robots_txt_tasks(conf, app)
    assets_tasks(conf, app)
    includes_tasks(conf, app)
    intersphinx_tasks(conf, app)
    release_tasks(conf, app)
    option_tasks(conf, app)
    api_tasks(conf, app)
    table_tasks(conf, app)
Example #4
0
def source_tasks(conf, sconf, app):
    pre_app = app.add('app')
    assets_tasks(conf, pre_app)
    primer_migration_tasks(conf, pre_app)
    pre_app.run()

    t = app.add('task')
    t.job = transfer_source
    t.args = [conf, sconf]
    t.target = os.path.join(conf.paths.branch_source)
    t.description = 'transferring source to {0}'.format(conf.paths.branch_source)

    app.run()
Example #5
0
def assets(args):
    c = fetch_config(args)

    with BuildApp.new(pool_type=c.runstate.runner,
                      pool_size=c.runstate.pool_size,
                      force=c.runstate.force).context() as app:
        if c.runstate.clean_generated is True:
            app.extend_queue(assets_clean(c))
        else:
            app.extend_queue(assets_tasks(c))
Example #6
0
def assets(args):
    c = fetch_config(args)

    with BuildApp.new(pool_type=c.runstate.runner,
                      pool_size=c.runstate.pool_size,
                      force=c.runstate.force).context() as app:
        if c.runstate.clean_generated is True:
            app.extend_queue(assets_clean(c))
        else:
            app.extend_queue(assets_tasks(c))
Example #7
0
def sphinx_content_preperation(app, conf):
    # Download embedded git repositories and then run migrations before doing
    # anything else.
    with app.context() as asset_app:
        asset_app.extend_queue(assets_tasks(conf))

    with app.context() as migration_app:
        migration_app.extend_queue(migration_tasks(conf))

    # Copy all source to the ``build/<branch>/source`` directory.
    with Timer('migrating source to build'):
        with app.context(randomize=True) as source_app:
            for (_, (build_config,
                     sconf)) in get_restricted_builder_jobs(conf):
                source_app.extend_queue(source_tasks(build_config, sconf))

    # load all generated content and create tasks.
    with Timer('loading generated content'):
        for (_, (build_config, sconf)) in get_restricted_builder_jobs(conf):
            for content, func in build_config.system.content.task_generators:
                app.add(Task(job=func, args=[build_config], target=True))

        app.randomize = True
        results = app.run()
        app.reset()

        for task_group in results:
            app.extend_queue(task_group)

    for ((edition, language, builder),
         (build_config, sconf)) in get_restricted_builder_jobs(conf):
        # these functions all return tasks
        app.extend_queue(image_tasks(build_config, sconf))
        for content_generator in (robots_txt_tasks, intersphinx_tasks,
                                  table_tasks, hash_tasks):
            app.extend_queue(content_generator(build_config))

        dependency_refresh_app = app.add('app')
        dependency_refresh_app.extend_queue(
            refresh_dependency_tasks(build_config))

        # once the source is prepared, we dump a dict with md5 hashes of all
        # files, so we can do better dependency resolution the next time.
        app.extend_queue(dump_file_hash_tasks(build_config))

        # we transfer images to the latex directory directly because offset
        # images are included using raw latex, and Sphinx doesn't know how
        # to copy images in this case.
        app.extend_queue(latex_image_transfer_tasks(build_config, sconf))

        msg = 'added source tasks for ({0}, {1}, {2}) in {3}'
        logger.debug(
            msg.format(builder, language, edition,
                       build_config.paths.branch_source))
def sphinx_content_preperation(app, conf):
    # Download embedded git repositories and then run migrations before doing
    # anything else.
    with app.context() as asset_app:
        asset_app.extend_queue(assets_tasks(conf))

    with app.context() as migration_app:
        migration_app.extend_queue(migration_tasks(conf))

    # Copy all source to the ``build/<branch>/source`` directory.
    with Timer('migrating source to build'):
        with app.context(randomize=True) as source_app:
            for (_, (build_config, sconf)) in get_restricted_builder_jobs(conf):
                source_app.extend_queue(source_tasks(build_config, sconf))

    # load all generated content and create tasks.
    with Timer('loading generated content'):
        for (_, (build_config, sconf)) in get_restricted_builder_jobs(conf):
            for content, func in build_config.system.content.task_generators:
                app.add(Task(job=func,
                             args=[build_config],
                             target=True))

        app.randomize = True
        results = app.run()
        app.reset()

        for task_group in results:
            app.extend_queue(task_group)

    for ((edition, language, builder), (build_config, sconf)) in get_restricted_builder_jobs(conf):
        # these functions all return tasks
        app.extend_queue(image_tasks(build_config, sconf))
        for content_generator in (robots_txt_tasks, intersphinx_tasks,
                                  hash_tasks):
            app.extend_queue(content_generator(build_config))

        dependency_refresh_app = app.add('app')
        dependency_refresh_app.extend_queue(refresh_dependency_tasks(build_config))

        # once the source is prepared, we dump a dict with md5 hashes of all
        # files, so we can do better dependency resolution the next time.
        app.extend_queue(dump_file_hash_tasks(build_config))

        # we transfer images to the latex directory directly because offset
        # images are included using raw latex, and Sphinx doesn't know how
        # to copy images in this case.
        app.extend_queue(latex_image_transfer_tasks(build_config, sconf))

        msg = 'added source tasks for ({0}, {1}, {2}) in {3}'
        logger.debug(msg.format(builder, language, edition, build_config.paths.branch_source))