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.
- Listens for webhooks from Bitbucket.
- Checks if the corresponding repository exists on GitHub.
- Syncs the GitHub repository with changes from Bitbucket.
- Node.js 22
- npm (Node Package Manager)
- Docker (optional, for running the app in a container)
-
Clone the repository:
git clone https://your-repo-url.git cd your-repo-directory -
Install the dependencies:
npm install
-
Create a
.envfile 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
To start the application, run the following command:
npm startThe app will start listening for webhooks on port 3000.
To run the tests, use the following command:
npm testTo build and run the application inside a Docker container:
-
Build the Docker image:
docker build -t portus.co.ihc.com/devops/bb-gh-sync . -
Run the Docker container:
docker run -p 3000:3000 portus.co.ihc.com/devops/bb-gh-sync
Contributions are welcome! Please open an issue or submit a pull request with your changes.
This project is licensed under the GNU General Public License v2.0. See the LICENSE file for details.