Skip to content

How to overlay a file such as README.md #43

@DarthHater

Description

@DarthHater

Hi there Copybara friends!

I'm working on another project using this fabulous tool, and I was wondering about a particular use case and how to best accomplish it.

core.workflow(
    name = "default",
    origin = git.origin(
        url = sourceUrl,
        ref = "master",
    ),
    destination = git.destination(
        url = destinationUrl,
        fetch = "master",
        push = "master",
    ),
    mode = "ITERATIVE",
    # Change path to the folder you want to publish publicly
    origin_files = glob(["**"], exclude = ["copy.bara.sky", ".copybara/**", "Jenkinsfile", "README.md"]),
    destination_files = glob(["**"]),

    authoring = authoring.pass_thru("THIS GUY <dude@email.com>"),
    transformations = [
      metadata.squash_notes(prefix = 'Public export of code:\n\n', show_description = False),
      core.copy(".copybara/public", "", paths = glob(["README.md"]))
    ],
)

I was wondering if this is the best way to accomplish overlaying a public README.md from an internal repo. I'm asking this publicly because I'm not 100% sure how to dry run the copybara stuff and see what a public repo will look like, and as well to just see if there is a better way to accomplish this. I think the core.replace stuff is a bit too granular, in this case replacing the file completely seems to make the most sense.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions