OpenTOSCA / docker-copybara

Docker image for Google's Copybara

Home Page:https://hub.docker.com/r/opentosca/copybara

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository and the respective Docker build is outdated. Please use another Docker build. See copybara#82 for hints.

Docker Copybara

A docker image for Google's Copybara

Copybara is the successor of Google's Makeing Opensource Easy. koppor's git-oss-releaser does not have the same functionalities as Copybara.

Google does not publish a docker image on his own. See copybara#82 for the discussion.

Dockerfile

With the prepared Dockerfile you can build a container where you can run copybara in a container with base/archlinux image.

Building

To build the container run the command in the directory containing the Dockerfile:

docker build --rm -t copybara .

Directory Preparation

<wd> is a placeholder for your working directory you want to use and should contain the following:

<wd>/copy.bara.sky
<wd>/<originRepository>
<wd>/<targetRepository>
  • copy.bara.sky has to contain the config for copybara execution.
  • <originRepository> has to contain the origin repository, if you use a local one.
  • <targetRepository> has to contain the target repository, if you use a local one.
  • <originRepository> and <targetRepository> has to be specified in the config file copy.bara.sky.

Running Copybara

Run the command in the directory <wd>:

docker run -v "$(pwd):/tmp/copybara" -it opentosca/copybara:latest copybara copy.bara.sky --force

Example with Linux Bash

Run following commands in the bash:

$ git clone https://github.com/OpenTOSCA/docker-copybara.git
$ cd docker-copybara
$ docker build --rm -t copybara .
$ mkdir targetRepo
$ cd targetRepo
$ git init --bare
$ cd ..

Create file copy.bara.sky in the current directory with following content (first example from https://github.com/google/copybara/blob/master/docs/examples.md with changed destination path):

urlOrigin = "https://github.com/google/copybara.git"
urlDestination = "file:///tmp/copybara/targetRepo"

core.workflow(
    name = "default",

    origin = git.origin(
        url = urlOrigin,
        ref = "master",
    ),

    destination = git.destination(
        url = urlDestination,
        fetch = "master",
        push = "master",
    ),

    destination_files = glob(["**"], exclude = ["README_INTERNAL.txt"]),

    authoring = authoring.pass_thru("Default email <default@default.com>"),
)

At last you can run the copybara in the docker container:

docker run -v "$(pwd):/tmp/copybara" -it opentosca/copybara:latest copybara copy.bara.sky --force

This will copy the content of the origin repository to the target repository you created in targetRepo.

About

Docker image for Google's Copybara

https://hub.docker.com/r/opentosca/copybara


Languages

Language:Dockerfile 100.0%