Update the repository name for Bamboo plan using Bamboo Command Line Interface ( CLI)
This article explains how to update the repository name for Bamboo plan using Bamboo Command Line Interface (CLI).
Instructions
Use the updateRepository action to update the repository name for the Bamboo plan. Refer to the sample function below:
--action updateRepository --plan TES-TRAIN --repository "CLI Repo" --name "Bamboo CLI Repo" --field repository.stash.repositorySlug=testing --repositoryKey BITBUCKET_SERVER --branch master --targetServer "$BITBUCKET_SERVER" --targetUser "$BITBUCKET_USER" --targetPassword "$BITBUCKET_PASSWORD" --field repository.stash.projectKey=PROJVJ
In the above action,
- plan value refers to Bamboo plan key.
- repository value refers to a repository name in Bamboo.
- name value refers to new name for Bamboo repository.
- field repository.stash.repositorySlug value refers to the repository name in Bitbucket. Refer to What is a slug in Bitbucket, to get the slug name for Bitbucket repository.
- repositoryKey refers to the repository type.
- branch value refers to the repository branch.
- targetServer value refers to repository URL.
- targetUser value refers to the username to authenticate the repository URL.
- targetPassword value refers to the password to authenticate the repository URL.
- field repository.stash.projectKey value refers to Bitbucket project key.
It is recommended to test this scenario in a non-production environment or run the action with the --simulate parameter to verify the behavior before deploying.