Go Buddy is a command-line tool designed to interact with the Buddy CI/CD Platform. It allows users to manage and run pipelines for continuous integration (CI) and continuous deployment (CD). With this tool, you can easily deploy to staging or production environments, ensuring a smooth and automated workflow for your development and deployment processes.
go install github.com/JacobAndrewSmith92/gobuddy@latest
config
deploy
The config command is used to create and update your configuration while using this tool. It provides subcommands to get, set, and reset configuration settings. This setup is required in order to use the tool. Below are the details on how to use these subcommands.
Need to create your buddy token first? Set it up here
Subcommand | Description |
---|---|
get |
Retrieves your current configuration |
set |
Create a new configuration |
set <key> <value> |
Set a specific configuration key |
reset |
Reset your configuration |
get
$ gobuddy config get
Current Configuration:
Token: a-valid-token
Workspace: fizzbuzz
Protected Branch: master
Protected Pipeline: Deploy to Production
set
(if one does not exist)
$ gobuddy config set
Enter your Buddy API token: ********
Enter your Buddy workspace: foobar
Enter the branch you want to protect: some-branch
Enter the pipeline you want to protect: some-pipeline
set <key> <value>
One of:
token
workspace
protected_branch
protected_pipeline
$ gobuddy config set token some-value
Token updated to: some-value
Configuration updated successfully!
$ gobuddy config set workspace some-workspace
Workspace updated to: some-workplace
Configuration updated successfully!
reset
$ gobuddy config reset
Are you sure you want to reset the configuration? (yes/no): yes
Configuration has been reset.
This command allows you to trigger a deployment pipeline for your project using the Buddy CI/CD platform. You can select a project, branch, and pipeline for deployment either by passing arguments and flags or through an interactive process.
This command retrieves and displays the details of the last deployment execution for your project. This includes information such as the status of the deployment, the branch that was deployed, the pipeline used, and the time of execution.
Subcommand | Type | Description | Required |
---|---|---|---|
<project> |
argument |
Pass the project name (repo) you want to deploy | false |
-b or --branch |
flag |
Pass this flag followed by a value if you want to specify your own git branch | false |
-p or --pipeline |
flag |
Pass this flag followed by a value if you want to specify your own pipeline ID | false |
-c or --current |
flag |
Pass this flag if you want to use the current branch of the directory | false |
If you don’t pass all arguments and flags, Go Buddy will pick up where you left off and guide you through some interactive steps:
- Project Selection: Displays a list of available projects.
- Branch Selection: Fetches and displays the branches for the selected project.
- Pipeline Selection: Displays a list of pipelines associated with the project.
Running with no arguments/flags passsed
$ gobuddy deploy
Running with the project
$ gobuddy deploy project-foobar
Running with the project and branch passed
$ gobuddy deploy project-foobar -b fizz-buzz
Running with all flags passed
$ gobuddy deploy project-foobar -c -b fizz-buzz -p 12345
Once you have ran a deployment, Go Buddy will ask you if you'd like to check the status of the deployment. You can do so by typing yes. As of today (09/18/2024), if you select no, you won't be able to check the status again. That logic will come in future improvements.
SUCCESSFUL
FAILED
INPROGRESS
ENQUEUED
SKIPPED
TERMINATED
NOT_EXECUTED
INITIAL