-
-
Notifications
You must be signed in to change notification settings - Fork 15
Home
The gitstrap
project aims to automate routine operations with GitHub such as managing repositories, organizations, teams, web-hooks and other resources. Each resource is represented as a yaml
specification document that could be fetched from an existing resource or created from scratch. Each document can be updated and the specification resource configuration can be applied using CLI gitstrap
tool.
The full specification format can be found here: /specifications
For Linux system you can use download script to get latest binary:
curl -L https://raw.githubusercontent.com/g4s8/gitstrap/master/scripts/download.sh | sh
This script downloads gistrap
CLI into ./gitstrap/
path of current directory. The binary could be copied to any of $PATH
directories.
On MacOS it can be installed using HomeBrew:
brew tap g4s8/.tap https://github.com/g4s8/.tap
brew install g4s8/.tap/gitstrap
On any system (including Windows) the CLI binary can be found at releases page.
Alternatively, it can be built from sources (you'll need git
, make
and go
installed on the system):
git clone --depth=1 https://github.com/g4s8/gitstrap.git
cd gitstrap
make build
sudo make install
To use gitstrap
CLI you need GitHub token. Some features depend on optional permissions:
-
repo
- required -
admin:org
- to manage organizations -
admin:org_hook
- to manage organization web-hooks -
delete_repo
- to delete repositories
A new token can be created here: https://github.com/settings/tokens/new
When a token is generated, it should be placed at ~/.config/gitstrap/github_token.txt
location.
The gitstrap
CLI consists of these primary commands:
-
get
- get GitHub resource, convert it intoyaml
format and print (possible sub-commands:repo
,org
,hooks
,teams
,protection
) -
create
- create a new resource from specyaml
file, and fail if it already exists -
apply
- apply resource specification to existing resource or create it if doesn't exist -
delete
- delete resource byyaml
spec
Global options:
-
--token
- overrides GitHub token from~/.config/gitstrap/github_token.txt
Use gitstrap --help
or gitstrap <command> --help
for more details.