This project downloads all Bitbucket repositories and every branch for each repository. The resulting downloads are compressed with tar.
This application works with Bitbucket App Passwords
The application requires the following environment variables to run.
BB_USER The username component of the Bitbucket App Password.
BB_PASSWORD The password component of the Bitbucket App Password.
BB_WORKSPACE The name of the Bitbucket workspace.
BB_RIPPER_EXPORT_DIRECTORY The path of the output.
With the optional environment variable BB_TEST_COUNTER you can pull down only a specified number of repositories. This is useful for testing purposes. All values that are non integer and lower that 1 will be ignored.
The application was developed and tested on MacOS with the Python 3.11 package managed with Homebrew.
To install Python dependencies
pip install -r requirements.txtTo set the environment variables: Rename env_setup.sh.example to env_setup.sh after adding values for your environment, then source the environment variables to add them to your session.
source env_setup.shTo run the application
cd bb-ripper
python3 .To run the docker image: Create a Docker environment file with the variables required, named docenv. Create a directory named data to store the repositories. This directory will be mounted to the /data volume in the container.
The repository contains a file named docenv.example that is a template for the docenv file.
docker pull jvrck/bbripper
docker run --env-file dockenv -v $(pwd)/data:/data --rm -it jvrck/bbripper:latestTo build the docker image
docker build --no-cache -t ripper .To run the image, create a docker environment file with the variables required named docenv. Create a directory named data to store the repositories. This directory will be mounted to the /data volume in the container.
docker run --env-file dockenv -v $(pwd)/data:/data --rm -it ripper:latestA variant of the image that has the AWS CLI preinstalled. This can be done during the build by passing a build argument to the Docker build command.
docker build --no-cache -t bbripper-aws --build-arg AWSCLI=TRUE .