You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am trying to create repositories and add them to specific projects by using:
curl -X POST -u "${bcUser}:${bcPass}" "https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_lower}" \
-H "Content-Type: application/json" \
-d '{"is_private": true, "language": "php", "project": {"key": '$project'}}'
But it is not considering the parameters passed. Just checked on the documentation:
And is_private, language and project don't seem to be part of the options specified. I am new on this, and I would like to be able to specify the privacy as well as moving the created repository to an existing project.
After creating the repository, I tried moving the repository to the existing project with the following command, but did not work either:
curl -X PUT -u "${bcUser}:${bcPass}" "https://api.bitbucket.org/2.0/workspaces/${owner}/projects/${project}" \
-d '{"repositories": "https://api.bitbucket.org/2.0/repositories/${owner}/'${repo_lower}'"}'
I am working on Bitbucket Cloud. Thanks in advance
I'm answering myself in case somebody needs it ( I assume the URL needs to be the last one...):
curl -X POST -u "${bcUser}:${bcPass}" \
-H "Content-Type: application/json" \
-d '{ "scm": "git", "is_private": true, "project": {"key": "'${project}'"}}' \ "https://api.bitbucket.org/2.0/repositories/${owner}/${repo_lower}"
Thank you so much!
Works great after removing simple quotes in "'${project}'" => "${project}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.