GithubHelp home page GithubHelp logo

bitbucket-pr-bot's Introduction

bitbucket-pr-bot

A job to promote a Pull Requests on GitOps repository

How it works

On each run, the bot will:

  1. Get the PR of the merged commit
  2. Clone the GitOps repository
  3. Promote the new PR in GitOps repository

Usage

Setup

  1. Create an application repository access token with pullrequest:read scope
  2. Create a gitops repository access token with pullrequest:write scope
  3. Set the environment variables:
    • GITOPS_SOURCE_ACCESS_TOKEN: Bitbucket application repository in step 1
    • GITOPS_ACCESS_TOKEN: Bitbucket gitops repository in step 2
    • GITOPS_BOT_EMAIL: Bitbucket gitops repository email that is associated with the Access token created in step 2

Run the bot with Docker

    docker run --rm \
      --env GITOPS_SOURCE_ACCESS_TOKEN \
      --env GITOPS_ACCESS_TOKEN \      
      --env GITOPS_BOT_EMAIL \      
      --env GITOPS_REPO \
      --env GITOPS_DESTINATION_BRANCH \
      --env GITOPS_SOURCE_BRANCH_PREFIX \
      --env BITBUCKET_COMMIT \
      --env BITBUCKET_REPO_OWNER \
      --env BITBUCKET_REPO_SLUG \
      --env BITBUCKET_REVIEWER_UUIDS \
      bitbucket-pr-bot:latest
  • GITOPS_DESTINATION_BRANCH: The branch that PR will be merged and deployed to environments such as main, master, develop, stg, qa
  • GITOPS_SOURCE_BRANCH_PREFIX: The prefix of the branch name that PR will be created from such as qa for testing, stg for staging, release for production
  • BITBUCKET_REVIEWER_UUIDS The list of string UUID of reviewers separated by ;. E.g {7ff3a816-c6c7-4cd7-8133};{7ff3a816-c6c7-4cd7-8133}

Bitbucket Pipelines example

  1. Add GITOPS_SOURCE_ACCESS_TOKEN and GITOPS_ACCESS_TOKEN and GITOPS_BOT_EMAIL to your repository variables

  2. Create a custom pipeline in your bitbucket-pipelines.yml file

    pipelines:
      custom:
        cc-bot:
          - step:
              name: Bitbucket PR Bot
              image: ghcr.io/thangnc/bitbucket-pr-bot:latest

bitbucket-pr-bot's People

Contributors

thangnc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.