Skip to content

Repository files navigation

Bitbucket to GitHub Repo Sync

This project is a Node.js application that listens for webhooks from Bitbucket and syncs the corresponding repositories on GitHub. It ensures that changes made in Bitbucket are reflected in the GitHub repositories.

Features

  • Listens for webhooks from Bitbucket.
  • Checks if the corresponding repository exists on GitHub.
  • Syncs the GitHub repository with changes from Bitbucket.

Prerequisites

  • Node.js 22
  • npm (Node Package Manager)
  • Docker (optional, for running the app in a container)

Installation

  1. Clone the repository:

    git clone https://your-repo-url.git
    cd your-repo-directory
  2. Install the dependencies:

    npm install
  3. Create a .env file in the root of the project and add the following environment variables:

    GITHUB_USER=your-github-username
    GITHUB_TOKEN=your-github-token
    BITBUCKET_REPO_URL=bitbucket-repo-clone-url
    GITHUB_REPO_URL=github-repo-clone-url
    PORT=3000

Usage

To start the application, run the following command:

npm start

The app will start listening for webhooks on port 3000.

Testing

To run the tests, use the following command:

npm test

Docker

To build and run the application inside a Docker container:

  1. Build the Docker image:

    docker build -t portus.co.ihc.com/devops/bb-gh-sync .
  2. Run the Docker container:

    docker run -p 3000:3000 portus.co.ihc.com/devops/bb-gh-sync

Contributing

Contributions are welcome! Please open an issue or submit a pull request with your changes.

License

This project is licensed under the GNU General Public License v2.0. See the LICENSE file for details.

Acknowledgements

About

Receives webhooks from host a's repos and checks to see if the repo exists on host b, then creates or syncs the repo.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages