Skip to content

Commit bf218b8

Browse files
authored
Merge pull request #41 from dimitraz/small-tweaks
Small tweaks
2 parents cefa5fb + 8407655 commit bf218b8

File tree

3 files changed

+47
-42
lines changed

3 files changed

+47
-42
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
= Contributing to the mobile CLI
1+
# Contributing to the mobile CLI
22

33
This document explains how to set up a development environment and get involved with Mobile CLI project.
44

5-
Before anything else, https://help.github.com/articles/fork-a-repo/[fork] the Mobile CLI project.
5+
Before anything else, [fork](https://help.github.com/articles/fork-a-repo/) the Mobile CLI project.
66

7-
== Tools We use
7+
## Tools We use
88

99
* Git
1010
* Go
1111
* Make
1212

13-
== Set Up OpenShift
13+
## Set Up OpenShift
1414

1515
The Mobile CLI targets Kubernetes and is intended to be developed against a running Kubernetes cluster,
1616
we use OpenShift as our Kubernetes distribution. The Mobile CLI is intended to help you work with Mobile Services running ontop of OpenShift.
17-
To provision these services, we levarage the https://github.com/kubernetes-incubator/service-catalog[Service Catalog] and the https://github.com/openshift/ansible-service-broker[Ansible Service Broker].
18-
To help get this infrastructure set up there is a https://github.com/aerogear/mobile-core#installing-from-a-development-release[ansible based installer] provided.
17+
To provision these services, we levarage the [Service Catalog](https://github.com/kubernetes-incubator/service-catalog) and the [Ansible Service Broker](https://github.com/openshift/ansible-service-broker).
18+
To help get this infrastructure set up there is a [ansible based installer](https://github.com/aerogear/mobile-core#installing-from-a-development-release) provided.
1919

20-
== Clone the repositiory
20+
## Clone the repositiory
2121

2222
As we are using Go, the path you clone this repo into is important.
2323

2424
* create the directory `mkdir -p $GOPATH/src/github.com/aerogear`
25-
* clone the repo `cd $GOPATH/src/github.com/aerogear && git clone git@github.com:aerogear/mobile-CLI.git`
26-
* add your own fork as the upstream target `git add remote upstream <your fork>`
25+
* clone the repo `cd $GOPATH/src/github.com/aerogear && git clone git@github.com:aerogear/mobile-CLI.git`
26+
* add your own fork as the upstream target `git add remote upstream <your fork>`
2727

28-
== Building the Mobile CLI
28+
## Building the Mobile CLI
2929

3030
To build the CLI locally you can run `make build` this command will run a set of checks and the unit tests before compiling the binary and outputting it into the current directory,
3131
if you only want to build the binary itself you can simply run `make build_binary`.
3232
Once built, you can access this binary and use it from the command line `./mobile`
3333
Remember however that the CLI is intended as a Kubernetes plugin so expects to find kube configuration in `~/.kube/config`. If you have setup OpenShift this should
3434
already be in place.
3535

36-
== Submitting changes to the Mobile CLI
36+
## Submitting changes to the Mobile CLI
3737

38-
=== Before making a pull request
38+
### Before making a pull request
3939

4040
There are a few things you should keep in mind before creating a PR.
4141

42-
* New code should have corresponding unit tests. An example of how we approach unit testing can be found in https://github.com/aerogear/mobile-CLI/blob/master/pkg/cmd/clients_test.go[clients_test.go].
42+
* New code should have corresponding unit tests. An example of how we approach unit testing can be found in [clients_test.go](https://github.com/aerogear/mobile-CLI/blob/master/pkg/cmd/clients_test.go).
4343

44-
* Ensure for new commands to read the https://github.com/aerogear/mobile-CLI/doc/adding_new_cmd.md[adding a new command] doc before hand.
44+
* Ensure for new commands to read the [adding a new command](https://github.com/aerogear/mobile-CLI/doc/adding_new_cmd.md) doc before hand.
4545

46-
* You Must run ```make build``` before creating the PR and ensure it must execute with no errors.
46+
* You must run ```make build``` before creating the PR and ensure it must execute with no errors.
4747

4848
* When needed, provide an explanation of the command and the expected output to help others that may review and test the change.
4949

50-
=== Making a pull request
50+
### Making a pull request
5151

52-
Make a https://help.github.com/articles/using-pull-requests[pull request (PR)] in the standard way.
52+
Make a [pull request (PR)](https://help.github.com/articles/using-pull-requests) in the standard way.
5353

5454
Use [WIP] at the beginning of the title (ie. [WIP] Add feature to the CLI) to mark a PR as a Work in Progress.
5555

56-
If you are not a member of the https://github.com/aerogear[aerogear org], the build job will pause for approval from a trusted approver.
56+
If you are not a member of the [aerogear org](https://github.com/aerogear), the build job will pause for approval from a trusted approver.
5757
Anyone who can login to Jenkins can approve.
5858

5959
Your PR will then be reviewed, questions may be asked and changes requested.
6060

6161
Upon successful review, someone will approve the PR in the review thread. Depending on the size of the change, we may wait for 2 LGTM from reviewers before merging.
6262

6363

64-
=== Major features
64+
### Major features
6565

6666
The aerogear community uses a proposal process when introducing a major feature in order to encourage collaboration and building the best solution.
6767

6868
Major features are things that take about 2 weeks of development or introduce disruptive changes to the code base.
6969

70-
Start the proposal process by reviewing the https://github.com/aerogear/proposals/blob/master/template.md[proposal template]. Use this document to guide how to write a proposal. Then, submit it as a pull request where the community will review the plan.
70+
Start the proposal process by reviewing the [proposal template](https://github.com/aerogear/proposals/blob/master/template.md). Use this document to guide how to write a proposal. Then, submit it as a pull request where the community will review the plan.
7171

7272
The proposal process also requires two approvals from the community before merging.
7373

74-
== Stay in touch
74+
## Stay in touch
7575

7676
* IRC: Join the conversation on Freenode: #aerogear
77-
* Email: Subscribe to the https://github.com/aerogear/mobile-CLI/doc/adding_new_cmd.md[aerogear mailing list]
77+
* Email: Subscribe to the [aerogear mailing list](https://lists.jboss.org/mailman/listinfo/aerogear-dev)

.github/ISSUE_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**This form is for bug reports and feature requests. Major features will go through a [proposal process](https://github.com/aerogear/mobile-cli/blob/master/CONTRIBUTING.adoc).**
1+
**This form is for bug reports and feature requests. Major features will go through a [proposal process](https://github.com/aerogear/mobile-cli/blob/master/.github/CONTRIBUTING.md).**
22

33
> # Feature:
44
> # Bug:

Readme.md renamed to README.md

+24-19
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
## The Mobile Cli is a standalone cli that can also be used a kubectl / oc plugin
1+
## The Mobile CLI is a standalone CLI that can also be used a kubectl / oc plugin
22

33
## Note this is still under construction and not yet fit for use
44

5-
The mobile cli focuses on a small set of commands to empower mobile focused developers to consume and take full advantage of the RedHat mobile suite
5+
The mobile CLI focuses on a small set of commands to empower mobile focused developers to consume and take full advantage of the RedHat mobile suite
66
of services ontop of Kubernetes / OpenShift.
77

88
It uses a language familiar to mobile developers and abstracts away some of the complexity of dealing with Kubernetes / OpenShift which can be
99
initially daunting and overwhelming.
1010

1111
### Examples
1212
Note not all of these commands currently exist but are present below to show the general concept
13-
```
1413

14+
```
1515
mobile get services
1616
1717
mobile provision fh-sync
@@ -23,8 +23,8 @@ mobile create integration fh-sync keycloak
2323
mobile create clientbuild <MobileClientID> <Git_Source_Url> [buildName]
2424
2525
mobile get buildartifact <clientBuildID>
26-
2726
```
27+
2828
### Checkout
2929

3030
```
@@ -39,15 +39,16 @@ git clone https://github.com/aerogear/mobile-cli
3939
glide install
4040
make build
4141
```
42-
To test run
42+
43+
To test, run:
4344

4445
```
4546
./mobile
4647
```
4748

4849
### Build for APB usage
4950

50-
To use the mobile-cli inside an APB container it needs to be compiled for the linux/amd64 platform:
51+
To use the mobile CLI inside an APB container it needs to be compiled for the linux/amd64 platform:
5152

5253
```
5354
make build_linux
@@ -57,20 +58,19 @@ make build_linux
5758

5859
### Pre req
5960

60-
- have a local kubernetes or oc cluster via something like minikube or oc cluster up
61+
- Have a local kubernetes or oc cluster via something like minikube or oc cluster up
6162
- Install glide (https://github.com/Masterminds/glide), e.g. `brew install glide`
6263

6364
### Setup the Custom Resource Definition
6465

6566
```
6667
oc login -u system:admin
6768
oc create -f artifacts/mobileclient_crd.yaml
68-
6969
```
7070

71-
In OpenShift, add the following to the edit and admin roles
71+
In OpenShift, add the following to the edit and admin roles:
7272

73-
```
73+
```yml
7474
- apiGroups:
7575
- mobile.k8s.io
7676
attributeRestrictions: null
@@ -85,38 +85,39 @@ In OpenShift, add the following to the edit and admin roles
8585
- update
8686
- watch
8787
```
88-
You can do this via the edit command in oc
89-
```
88+
89+
You can do this via the edit command in oc:
90+
91+
```bash
9092
oc edit clusterrole admin # add the above and save
9193
oc edit clusterrole edit # add the above and save
9294
```
9395

9496
### Setup the plugin
9597

9698
- have the [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) command line tool or the [oc command line tool](https://docs.openshift.org/latest/cli_reference/get_started_cli.html#installing-the-cli) already installed
97-
- It should be version k8s version 1.8 or OpenShift 3.7 or later
99+
- it should be version k8s version 1.8 or OpenShift 3.7 or later
98100
- create a new dir ```mkdir -p ~/.kube/plugins/mobile```
99101
- copy the plugin.yaml to the dir ```cp ./artifacts/cli_plugin.yaml ~/.kube/plugins/mobile```
100-
- install the mobile cli binary onto your $PATH
102+
- install the mobile CLI binary onto your $PATH
101103

102104
### Basic usage
103105

104106
To access the plugin you can use the following command:
105107
```kubectl plugin mobile <command>```
106108

107109
You can also use it standalone as it will pick up on your kube configuration:
108-
109110
```mobile --namespace=mine <command>``` notice we pass the namespace here.
110111

111112
**Passing flags**
112113

113-
To pass flags when using the plugin ensure to use the ```--``` option
114-
114+
To pass flags when using the plugin ensure to use the ```--``` option:
115115
```kubectl plugin mobile -- create client --<someflag> ```
116116

117117

118118
## Design
119-
The design of the cli API attempts to give a familiar feel to users familiar wil the kubectl and oc CLIs.
119+
120+
The design of the CLI API attempts to give a familiar feel to users familiar wil the kubectl and oc CLIs.
120121
It is also intended to use parlance familiar to mobile developers in order to help them become more productive
121122
and avoid needing to know the innards of various kubernetes resources.
122123

@@ -134,7 +135,7 @@ required in order to consume your mobile aware services from your mobile client.
134135
- **ServiceConfig:** the Service Config stores information about a mobile aware service and is backed by a secret. This information is then used to populate your mobile client's config.
135136
This information could be anything but often is made up of values such as the URI of the service and perhaps some headers and configuration particular to that service.
136137

137-
- **ClientBuild** the ClientBuild is backed by a regular BuildConfig however the cli will help you create this BuildConfig with as little effort as possible. Allowing you to focus on
138+
- **ClientBuild** the ClientBuild is backed by a regular BuildConfig however the CLI will help you create this BuildConfig with as little effort as possible. Allowing you to focus on
138139
just the mobile parts rather than needing to understand how to setup and manage a buildconfig and builds. For example, it will help you manage build credentials, and keys and ensure the build integrates
139140
seamlessly with the areogear mobile build farm .
140141

@@ -209,3 +210,7 @@ stop
209210

210211
- clientbuild <buildName>
211212
213+
214+
## Contributing
215+
216+
Check the [`CONTRIBUTING.md`](https://github.com/aerogear/mobile-cli/blob/master/.github/CONTRIBUTING.md) file.

0 commit comments

Comments
 (0)