Hi all,
I'm trying to automate my bitbucket repo creation via a bash script and am stuck on the following endpoint
/2.0/repositories/{workspace}/{repo_slug}/pipelines_config
I'm trying the following:
curl -X PUT -v -u "$BITBUCKET_AUTH_EMAIL":"$BITBUCKET_AUTH_PASS" -H "Content-Type: application/json" \
https://api.bitbucket.org/2.0/repositories/$BITBUCKET_USER/$REPO_SLUG/pipelines_config -d \
'{
"enabled": true
}'
which I thought would be the same as going 'Repository Settings > Pipeline > Settings > Enable Pipeline'
but this returns :
{"type": "error", "error": {"message": "Resource not found"}}
I've also tried a few variations:
curl -X PUT -v -u "$BITBUCKET_AUTH_EMAIL":"$BITBUCKET_AUTH_PASS" -H "Content-Type: application/json" \
https://api.bitbucket.org/2.0/repositories/$BITBUCKET_USER/$REPO_SLUG/pipelines_config -d \
'{
"enabled": true
}'
curl -X PUT -v -u "$BITBUCKET_AUTH_EMAIL":"$BITBUCKET_AUTH_PASS" -H "Content-Type: application/json" \
https://api.bitbucket.org/2.0/repositories/$BITBUCKET_USER/$REPO_SLUG/pipelines_config -d \
'{
"enabled": true,
"type": "repository_pipelines_configuration"
}'
but these also return the above result.
Other than that i've been able to setup pipeline vars & pipeline key pair without any issues so any help pointing me in the right direction would be appreciated.
After contacting support the issue was resolved by using the users Bitbucket username instead of
BITBUCKET_AUTH_EMAIL
in the authentication.
Can confirm to reproduce if my app-password has all the needed rights.
If not, I get an error message back telling me which rights are missing. However if I try to change that (e.g. wrong repository slug), the error message stays the same, only for credentials.
The missing resource error is only shown if credentials are fine. I have no idea why it does not work. Also tried with GET first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.