Exemple #1
0
def create_rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *core_target_types_rules(),
            *dependencies.rules(),
            *docker_binary.rules(),
            *docker_build_args.rules(),
            *docker_build_context.rules(),
            *docker_build_env.rules(),
            *dockerfile.rules(),
            *dockerfile_parser.rules(),
            *package_image.rules(),
            *package_pex_binary.rules(),
            *pex_from_targets.rules(),
            *shell_target_types_rules(),
            *target_types_rules.rules(),
            package.find_all_packageable_targets,
            QueryRule(BuiltPackage, [PexBinaryFieldSet]),
            QueryRule(DockerBuildContext, (DockerBuildContextRequest, )),
        ],
        target_types=[
            DockerImageTarget,
            FilesGeneratorTarget,
            PexBinary,
            ShellSourcesGeneratorTarget,
            ShellSourceTarget,
        ],
    )
    return rule_runner
Exemple #2
0
def rules():
    return [
        *dependencies.rules(),
        *docker_binary.rules(),
        *docker_build_args.rules(),
        *docker_build_context.rules(),
        *docker_build_env.rules(),
        *dockerfile.rules(),
        *dockerfile_parser.rules(),
        *package_image.rules(),
        *publish.rules(),
        *run_image.rules(),
    ]
Exemple #3
0
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *rules(),
            *docker_binary.rules(),
            QueryRule(PublishProcesses, [PublishDockerImageRequest]),
            QueryRule(DockerBinary, []),
        ],
        target_types=[DockerImageTarget],
    )
    rule_runner.set_options(
        [],
        env_inherit={"PATH", "PYENV_ROOT", "HOME"},
    )
    rule_runner.write_files(
        {
            "src/default/BUILD": """docker_image()""",
            "src/skip-test/BUILD": """docker_image(skip_push=True)""",
            "src/registries/BUILD": """docker_image(registries=["@inhouse1", "@inhouse2"])""",
        }
    )
    return rule_runner