Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Update deployment environment variables in another repo with Bitbucket API

dedwards
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 4, 2020

I have one (1) workspace : sampleproject

I have multiple repos in this workspace (e.g repo1, repo2 ....... repoX)

When I run a pipeline in repo1 i want to call bitbuckets API to update a deployment environment variable in repo2.

I have been trying but with no luck. see below the error message returned by the API call

 

{"type": "error", "error": {"message": "workspace"}}

 

see my bitbucket-pipelines.yml below

 

pipelines:
   default:
       - step:
            name: 'Build'
            caches:
         - dotnetcore
script:
- 'curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $PIPELINES_JWT_TOKEN" -d ''{"key":"key", "value":"value", "secured":false }'' https://api.bitbucket.org/2.0/repositories/sampleproject/repo2_slug/deployments_config/environments/environmentUUIDcomeshere/variables'

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events