bbox
is a handy CLI tool for working with TeamCity. Whether you need to kick off builds, manage the build queue, or clean up unused resources, bbox makes these tasks simpler and more efficient. It's designed to be versatile and user-friendly, helping you streamline your continuous integration workflows.
You can download a binary for Linux or OS X on the GitHub releases page. You
can use curl
or wget
to download it. Don't forget to chmod +x
the file!
Pull bbox
from the Docker repository:
docker pull similarweb/bbox
Or run bbox
from source:
git clone https://github.com/similarweb/bbox.git
If you are within the cloned repository, execute bbox using:
go run bbox [command] [Flags]
For Docker users, run:
docker run -it bbox [command] [Flags]
- Note: The -it flag is crucial when running bbox with Docker. It ensures that the container runs interactively, allowing you to provide input and receive output in real-time.
Global flags can be used with any bbox command to control its behavior:
Flags | Description |
---|---|
-h, --help |
Display help for Bbox or any specific command. Use bbox -h for general help and bbox [command] -h for command-specific help. |
-l, --log-level string |
Log level (debug, info, warn, error, fatal, panic) (default "info") |
--teamcity-url string |
Teamcity URL (default "https://teamcity.similarweb.io/") |
--teamcity-username string |
Teamcity username |
--teamcity-password string |
Teamcity password |
The trigger command is used to trigger a single TeamCity build. It allows you to specify various parameters such as the build type, branch name, and properties.
go run bbox trigger [flags]
Flags | Description |
---|---|
--artifacts-path string |
Path to download artifacts to (default "./") |
-b, --branch-name string |
The branch name (default "master") |
-i, --build-type-id string |
The build type |
-d, --download-artifacts |
Download artifacts |
-p, --properties stringToString |
The properties in key=value format (default []) |
--require-artifacts |
If downloadArtifacts is true, and no artifacts found, return an error |
-w, --wait-for-build |
Wait for build to finish and get status |
-t, --wait-timeout duration |
Timeout for waiting for build to finish (default 15m0s) |
go run main.go trigger \
--teamcity-username "<Username>" \
--teamcity-password '<Password>' \
--build-type-id "<BuildIDType>" \
--properties "key1=value1,key2=value2"
The multi-trigger command is used to trigger multiple TeamCity builds simultaneously. It accepts a combination of build parameters, allowing for more complex and automated build processes.
go run bbox multi-trigger [flags]
Flags | Description |
---|---|
--artifacts-path string |
Path to download artifacts to (default "./") |
-c, --build-params-combination strings |
Combinations as 'buildTypeID;branchName;downloadArtifactsBool;key1=value1&key2=value2' format. Repeatable. Example: 'myBuildId;master;true;key=value&key2=value2' |
--require-artifacts |
If downloadArtifactsBool is true, and no artifacts found, return an error |
-w, --wait-for-builds |
Wait for builds to finish and get status (default true) |
-t, --wait-timeout duration |
Timeout for waiting for builds to finish, default is 15 minutes (default 15m0s) |
go run main.go multi-trigger \
--teamcity-username "<Username>" \
--teamcity-password '<Password>' \
--build-params-combination "myBuildId;master;true;env=production&logLevel=verbose"
--build-params-combination "buildID123;develop;false;env=staging&debug=true>"
--build-params-combination "buildID;feature-branch;true;env=testing&ogLevel=info>"
--artifacts-path "./artifacts" \
The clean
command is used to remove unused or unwanted resources in a TeamCity server environment. This command helps in maintaining a clean and efficient CI environment.
go run bbox clean [command] [flags]
queue
Clear the TeamCity Build Queuevcs
Delete all unused VCS Roots
This sub-command clears the build queue in a TeamCity server environment. It identifies all queued builds and removes them from the queue, ensuring that no pending builds remain.
go run bbox clean queue [flags]
This sub-command identifies, lists, and deletes all unused VCS Roots in a TeamCity server environment. An unused VCS Root is defined as a VCS Root that is neither linked to any build configurations nor included in any build templates. This helps in keeping the TeamCity environment clean and free of unnecessary resources.
go run bbox clean vcs [flags]
Flags | Description |
---|---|
-c, --confirm |
Automatically confirm to delete all unused VCS Roots without prompting the user |
go run main.go clean vcs \
--teamcity-username "<Username>" \
--teamcity-password '<Password>' \
--confirm
The completion
command generates the autocompletion script for bbox
for the specified shell. Autocompletion scripts help to improve the user experience by providing command and flag suggestions as you type. See each sub-command's help for details on how to use the generated script.
go run bbox completion [command] [flags]
Flags | Description |
---|---|
--no-descriptions |
disable completion descriptions |
bash
Generate the autocompletion script for Bashfish
Generate the autocompletion script for Fishpowershell
Generate the autocompletion script for PowerShellzsh
Generate the autocompletion script for Zsh
Generate the autocompletion script for the Bash shell. This script depends on the bash-completion
package. If it is not installed already, you can install it via your OS's package manager.
go run bbox completion bash [flags]
To load completions in your current shell session:
source <(bbox completion bash)
To load completions for every new session, execute once:
bbox completion bash > /etc/bash_completion.d/bbox
bbox completion bash > $(brew --prefix)/etc/bash_completion.d/bbox
- Note: You will need to start a new shell for this setup to take effect.
Generate the autocompletion script for the Fish shell.
go run bbox completion fish [flags]
To load completions in your current shell session:
bbox completion fish | source
To load completions for every new session, execute once:
bbox completion fish > ~/.config/fish/completions/bbox.fish
- Note: You will need to start a new shell for this setup to take effect.
Generate the autocompletion script for powershell.
go run bbox completion fish [flags]
To load completions in your current shell session:
bbox completion powershell | Out-String | Invoke-Expression
To load completions for every new session, add the output of the above command to your powershell profile.
Generate the autocompletion script for the Zsh shell.
go run bbox completion zsh [flags]
If shell completion is not already enabled in your environment, you will need to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrc
To load completions in your current shell session:
source <(bbox completion zsh)
To load completions for every new session, execute once:
bbox completion zsh > "${fpath[1]}/_bbox"
bbox completion zsh > $(brew --prefix)/share/zsh/site-functions/_bbox
- Note: You will need to start a new shell for this setup to take effect.
Print the version number of bbox
bbox version [flags]
Contributions are always welcome!
See CONTRIBUTING for ways to get started.