Skip to content

Commit 76912a7

Browse files
committed
Update docs
1 parent 57703df commit 76912a7

5 files changed

Lines changed: 84 additions & 14 deletions

File tree

CONTRIBUTION.md renamed to CONTRIBUTING.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
* [Requirements](#requirements)
77
* [Environment Variables and Test Data](#environment-variables-and-test-data)
88
* [Refresh Test Data](#refresh-test-data)
9-
* [Branching](#branching)
109
* [Issue Tracker](#issue-tracker)
10+
* [Branching](#branching)
11+
* [Code Generator](#code-generator)
12+
* [Good Commit Message Examples](#good-commit-message-examples)
1113
* [Before Pushing your Commit](#before-pushing-your-commit)
12-
* [Custom Packages](#custom-packages)
14+
* [Tips and Tricks](#tips-and-tricks)
15+
* [Custom Packages we are using](#custom-packages-we-are-using)
1316
* [Test Driven Development](#test-driven-development)
1417
* [How the Commands Authenticate](#how-the-commands-authenticate)
1518
* [Commands Pattern](#commands-pattern)
@@ -58,6 +61,14 @@ source testdata/credentials.sh
5861
testdata/seeder.sh
5962
```
6063

64+
### Issue Tracker
65+
66+
[![Throughput Graph](http://graphs.waffle.io/devopsctl/gitlabctl/throughput.svg)](https://waffle.io/devopsctl/gitlabctl/metrics)
67+
68+
* Ensure that you are working on an [Issue](https://github.com/devopsctl/gitlabctl/issues)
69+
and is visible in [Waffle Issue Tracker](https://waffle.io/devopsctl/gitlabctl).
70+
* Ensure to create a branch for your Issue.
71+
6172
### Branching
6273

6374
* Branch name should be in the format of `{{issueNumber}}-{{shortTaskName}}`.
@@ -66,13 +77,17 @@ Example: `19-add-group-get-cmd`.
6677
Use `git pull --rebase origin master` or `git pull --rebase origin branchName`
6778
as much as possible.
6879

69-
### Issue Tracker
80+
### Code Generator
7081

71-
[![Throughput Graph](http://graphs.waffle.io/devopsctl/gitlabctl/throughput.svg)](https://waffle.io/devopsctl/gitlabctl/metrics)
82+
Once you get the basics of creating a gitlabctl command, you will find out that most code are repeatable.
83+
This is where the `gitlabctl gencode` commands can be of help.
7284

73-
* Ensure that you are working on an [Issue](https://github.com/devopsctl/gitlabctl/issues)
74-
and is visible in [Waffle Issue Tracker](https://waffle.io/devopsctl/gitlabctl).
75-
* Ensure to create a branch for your Issue.
85+
Please use it in for your own convenience. Feedback about this command is also appreciated!
86+
87+
### Good Commit Message Examples
88+
89+
* `new_group: fix known issue when printing output` - when patching an existing command
90+
* `Add new command get labels` - when adding a new command
7691

7792
### Before Pushing your Commit
7893

@@ -86,7 +101,19 @@ community may be able to answer your questions.
86101
* If you are not changing code (e.g: updating docs or adding test data),
87102
use __ci skip__ in commit message to [Skip TravisCI build](https://docs.travis-ci.com/user/customizing-the-build/#Skipping-a-build)
88103

89-
## Custom Packages
104+
### Tips and Tricks
105+
106+
Use `grm cmd subcmd` for ease of testing a command.
107+
* How: `alias grm='go run main.go'`
108+
* Example Usage: `grm get groups`
109+
110+
Use `gt` for ease of running `go test`.
111+
112+
* How: `alias gt='go test -v ./...'`
113+
* Example Usage: `gt -run NewGroup`
114+
115+
116+
## Custom Packages we are using
90117

91118
* Gitlab api client - https://godoc.org/github.com/xanzy/go-gitlab
92119
* Commandline flags - https://github.com/spf13/cobra
@@ -105,6 +132,8 @@ Authenticate using environment variables.
105132
* Private token authentication - `GITLAB_PRIVATE_TOKEN` and `GITLAB_API_HTTP_URL`
106133
* OAuth2 token authentication - `GITLAB_OAUTH_TOKEN` and `GITLAB_API_HTTP_URL`
107134

135+
Authenticate using `gitlabctl login` command.
136+
108137
## Commands Pattern
109138

110139
The command chain format is inspired from `kubectl` or `oc` Verb -> Subject -> Flags.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ gitlabctl completion -h
2424

2525
## Contributing
2626

27-
Contributors are welcomed with love! Please read [CONTRIBUTING.md](./CONTRIBUTION.md) for the process for submitting pull requests to us.
27+
Contributors are welcomed with love! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for the process for submitting pull requests to us.
2828

2929
## Gitlab Commands Available
3030
### Authentication

docs/gitlabctl_gencode.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## gitlabctl gencode
2+
3+
For gitlabctl developers only
4+
5+
### Synopsis
6+
7+
For gitlabctl developers only
8+
9+
```
10+
gitlabctl gencode [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-f, --file string command file name
17+
-h, --help help for gencode
18+
--max-args int command max accepted args
19+
-n, --name string command variable name
20+
-p, --parent string command parent variable name
21+
-s, --short string command short description
22+
-u, --use string command use
23+
```
24+
25+
### Options inherited from parent commands
26+
27+
```
28+
--config string config file (default is $HOME/.gitlabctl.yaml)
29+
```
30+
31+
### SEE ALSO
32+
33+
* [gitlabctl](gitlabctl.md) - Gitlab command-line interface
34+
35+
###### Auto generated by spf13/cobra on 16-Jun-2018

docs/gitlabctl_new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Create a Gitlab resource
2222
### SEE ALSO
2323

2424
* [gitlabctl](gitlabctl.md) - Gitlab command-line interface
25-
* [gitlabctl new branch](gitlabctl_new_branch.md) - Create a new branch for a project repository
25+
* [gitlabctl new branch](gitlabctl_new_branch.md) - Create a new branch for a specified project
2626
* [gitlabctl new group](gitlabctl_new_group.md) - Create a new group by specifying the group name as the first argument
2727
* [gitlabctl new member](gitlabctl_new_member.md) - Create a new member by specifying the member name as the first argument
2828
* [gitlabctl new project](gitlabctl_new_project.md) - Create a new project by specifying the project name as the first argument

docs/gitlabctl_new_branch.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
## gitlabctl new branch
22

3-
Create a new branch for a project repository
3+
Create a new branch for a specified project
44

55
### Synopsis
66

7-
Create a new branch for a project repository
7+
Create a new branch for a specified project
88

99
```
1010
gitlabctl new branch [flags]
1111
```
1212

13+
### Examples
14+
15+
```
16+
gitlabctl new branch project23 --name=release-x --ref=master
17+
```
18+
1319
### Options
1420

1521
```
1622
-h, --help help for branch
17-
-b, --name string The name of the branch
18-
-p, --ref string The branch name or commit SHA to create branch from
23+
-n, --name string The name of the branch
24+
-r, --ref string The branch name or commit SHA to create branch from
1925
```
2026

2127
### Options inherited from parent commands

0 commit comments

Comments
 (0)