I'm developing a python project within windows and would like to implement a semantic versioning numbering.
I red:
and some other blogs / articles but do not get it correctly
Currently I follow :
I have curl running onder windows and I'm doing command
curl -v -H "Content-Type: application/json" -XPUT -d "{'next': 2.1 }" --user "u:p" --url "https://api.bitbucket.org/2.0/repositories/<workspace-id>/<repo-slug>/pipelines_config/build_number"
The response is an error in authentication. Following the article:
https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/
I need to create an app password which I did with the following : repositires admin, pull request write, pipelines edit variabled
Then run the command:
curl -v -H "Content-Type: application/json" -XPUT -d "{'next': 2.1 }" --user "test3:XXX" --url "https://api.bitbucket.org/2.0/repositories/<workspace-id>/<repo-slug>/pipelines_config/build_number"
But still I do have an error on username password.
Also: when I try to run the curl in with my atlassion credentials then the result is
Your credentials lack one or more required privilege scopes.", "detail": {"required": ["pipeline:variable"], "granted": ["pullrequest:write"]}}}
Any suggestion what to do to get this running?
Hi @Marcel and welcome to the community!
I am not really sure how semantic versioning is related to the API call you are using.
The following endpoint you are using updates the next build number that should be assigned to a pipeline, if you are using Bitbucket Pipelines:
Please note that Pipelines build numbers are integers, so you cannot assign to a build number a value like '2.1'.
A few things I noted regarding your API call:
(1) When you give credentials with
--user "test3:XXX"
the part test3 should be the username of the Bitbucket account you generated this app password for.
It should not be the label of the app password (this is a common mistake I see).
The username of the account can be found here https://bitbucket.org/account/settings/ after you log in to the account.
Please ensure you are using the correct one.
(2) The part XXX should be an app password with at least Pipelines: Edit variables permissions. The account's password cannot be used, only an app password.
Please make sure you use the correct username, and if you still see the same error ("Your credentials lack one or more required privilege scopes") generate a new app password with at least Pipelines: Edit variables permissions.
(3) In the data part:
-d "{'next': 2.1 }"
The build number needs to be an integer, you cannot use a number like 2.1
Additionally, the "next" parameter needs to be within double quotes, you can adjust the data as follows:
-d '{"next": 30 }'
where 30 you can replace with any integer higher than the current latest build number for this repository.
Just a heads up, I will remove the workspace-id and repo name from your post to comply with our privacy policy.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.