When I try to clone a plan and I need change the subversion repository for different plan. But it also need specify the repositoryId when I try to "updateRepository". I would like to have automation way to get the repositoryId. Is it possible do it via this CLI?
Thank you.
Yongjun Rong
There isn't a way to list existing ones currently. Open an issue. If you run addRepository, then the repository id is returned on the command.
Thanks for your quick response. But need another getRepositoryId when specify and plan key and the repo name. No, I will try to access the db directly to get the id as a tempaory workaround.
I cannot use the addRepository because the repository is cloned when I try to clonePlan. I need updateRepository. Or when after clonePlan, it will be great if it can return the repositoryId
I will open an issue. Thank you again.
Sorry I cannot login to the onDemand
If you don't have an id already, click on: Create an account
Hi:
As workarround we execute a HTTP GET to:
http://<my_host>:8085/chain/admin/config/editChainRepository.action?os_username=<my_user>&os_password=<my_password>&planKey=<my_playkey>
using:
<my_host>: your bamboo host:
<my_user>: your bamboo user
<my_password>: your bamboo password
<my_plankey>: is the combination "PROJECT-PLAN" for your project ('-' must be included).
Then you can parse the response and search for repositoryId.
I only test this on bamboo 4.4.5, but maybe works on others versions.
Regards,
Good idea! Although I had to use buildKey instead of planKey for the releases I was testing with (4.2 and 5.0 EAP). Translating that into CLI terms, you can use:
--action renderRequest --quiet --request "/chain/admin/config/editChainRepository.action?buildKey=XXX-DEF" --findReplaceRegex ".*repositoryId=(\d+).*:\$1" To get: 37159110
That only gets the first repository.
Thanks Bob:
Just as a side note, on windows I had to remove the "\" scape character from \$ on:.*repositoryId=(\d+).*:\$1
.*repositoryId=(\d+).*:\$1
So the final sentence that works on windows will be:
--action renderRequest --quiet --request "/chain/admin/config/editChainRepository.action?buildKey=XXX-DEF" --findReplaceRegex ".*repositoryId=(\d+).*:$1"
It looks like you're new here. Sign in or register to get started.