Skip to content

statens-pensjonskasse/bucketctl

Repository files navigation

bucketctl

A simple CLI-tool written i Go for interacting with the BitBucket API.

Config blir lagret under $HOME/.config/bucketctl/config.yaml

Installasjon

make install

Help

bucketctl has a built-in help command

bucketctl help

Configuration

To use some of the functions you will need an access-token. This token can be generated in your profile settings in Bitbucket.

For easy of use this token can be stored in a config file together with the rest of the configuration, e.g.

bucketctl config set --token <token> --base-url <url> --git-url <ssh>

It's also possible to create different contexts based on this base config. To create a new context you can e.g. run

bucketctl config context create --context infra --key INFRA --include-repos

This lets you use the context -x infra instead of having to write --project INFRA --include-repos.

Examples

Basic

Fetch all projects

bucketctl get projects

Fetch all repositories under the PROJ-project

bucketctl get repos -p PROJ

To clone every repository in a project, run

bucketctl git clone -p PROJ

All repositories will then be cloned into a folder name PROJ unless another folder is specified.

To update the main brain of all repositories in a project, use the --update flag

bucketctl git clone -p PROJ --update

Project Configuration

Run

bucketctl get project-config -p PROJ

to fetch the current project configuration. New project configuration can be applied by running

bucketctl apply -f <PROJ>.yaml

To check which changes are to be made you can add the --dry-run flag.

Read the project config documentation for additional details.

About

bucketctl eies og forvaltes av Team Applikasjonsplattform

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages