update bitbucket build status to target repo

Naveen Mishra March 8, 2024

i have azure devops pipeline which is used to send build status on bitbucket which is on-premises and we sync bitbucket with azure devops repo, so i am checking out two repo one is "xyz-infra" where our all infra and azure devops pipeline file is present and one checkout from "abc-int" from developer code to build from our pipeline and deploy. But when we run the pipeline, it is sending build status to our "abzc-int" repo from where we run pipeline but i want to send the build status to "abc-int" repo in bitbucket . i am using this yml for api call 

parameters:
  state: ''
  sourceVersion: ''
  buildNumber: ''
  sourceBranch: ''
  buildId: ''
  serviceEndpoint: ''
  runOnFail: false
steps:
  - task: restCallBuildTask@0
    displayName: 'Set Commit Status: ${{ parameters.state }}'
    condition: or(and(succeeded(), not(${{ parameters.runOnFail }})), and(failed(), ${{ parameters.runOnFail }}))
    inputs:
      webserviceEndpoint: '${{ parameters.serviceEndpoint }}'
      relativeUrl: '/build-status/1.0/commits/${{ parameters.sourceVersion }}'
      httpVerb: POST
      body: >-
        {
          "state": "${{ parameters.state }}",
          "key": "${{ parameters.buildId }}",
          "name": "${{ parameters.buildNumber }}",
          "url": "https://dbhfhfrastructure.visualstudio.com/bbbbb/_build/results?buildId=${{ parameters.buildId }}",
          "description": "${{ parameters.buildNumber }} - ${{ parameters.sourceBranch }}"
        }

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events