client/DEVELOPMENT.md

2.6 KiB

Development

This doc explains how to setup a development environment so you can get started contributing to Knative Client. Also take a look at:

Prerequisites

Follow the instructions below to set up your development environment. Once you meet these requirements, you can make changes and build your own version of Knative Client!

Before submitting a PR, see also contribution guide.

Sign up for GitHub

Start by creating a GitHub account, then setup GitHub access via SSH.

Install requirements

You must install these tools:

  1. go: The language Knative Client is built in (1.11.4 or later)
  2. git: For source control
  3. kubectl: For managing development environments

Create a cluster

  1. Set up a Knative
    • You can also setup using limited install guides for eg: Minikube/Minishift.

Checkout your fork

To check out this repository:

  1. Create your own fork of this repo
  2. Clone it to your machine:
git clone git@github.com:${YOUR_GITHUB_USERNAME}/client.git
cd client
git remote add upstream git@github.com:knative/client.git
git remote set-url --push upstream no_push

Adding the upstream remote sets you up nicely for regularly syncing your fork.

Once you reach this point you are ready to do a full build and test as described below.

Building Knative Client

Once you've setup your development environment, let's build Knative Client.

Dependencies:

go mod is used and required for dependencies.

Building:

$ hack/build.sh

It builds kn binary in your current directory. You can start playing with it.

Notes:

  • For building, Go 1.11.4 is required due to a go mod issue.
  • If you are building in your $GOPATH folder, you need to specify GO111MODULE for building it
# if you are building in your $GOPATH
GO111MODULE=on go build ./cmd/...

You can now try updating code for client and test out the changes by building the kn binary.