Skip to content

Commit

Permalink
minor reorganization for CONTRIBUTING.md (#5270)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kriss <[email protected]>
  • Loading branch information
skriss authored Apr 11, 2023
1 parent e9c0b0d commit 4e82e78
Showing 1 changed file with 35 additions and 34 deletions.
69 changes: 35 additions & 34 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,41 @@ This section describes how to build Contour from source.

### Fetch the source

Contour uses [`go modules`][2] for dependency management.
1. [Fork][3] the projectcontour/contour repository.

1. [Fork][3] the repo
2. Create a local clone:

2. Create a local clone
```
git clone [email protected]:YOUR-USERNAME/contour.git
```
or
```
git clone https://github.com:YOUR-USERNAME/contour
```
### Running your first build
To build the Contour binary:
```shell
go build ./cmd/contour
```
git clone [email protected]:YOUR-USERNAME/contour.git

### Running unit tests

To run all of the unit tests:

```shell
go test ./...
```

To run the tests for a single package, change to the package directory and run:

### Running your first build
```shell
go test .
```

### Deploying to a local kind cluster

The simplest way to get up and running is to build Contour in a Docker container and to deploy it to a local Kind cluster.
These commands will launch a Kind cluster and deploy your build of Contour to it.
Expand All @@ -65,43 +88,21 @@ To remove the Kind cluster and all resources, run:
make cleanup-kind
```

### Pre-submit checks

### Building locally

To build Contour locally, run:
To run all checks locally before submitting a pull request, run:

```
make
```

This uses a `go install` and produces a `contour` binary in your `$GOPATH/bin` directory.


### Running the unit tests

Once you have Contour building, you can run all the unit tests for the project:

```
make check
```

To run the tests for a single package, change to package directory and run:

```
go test .
```shell
make checkall
```

### Lint
This builds the binary, runs unit tests, runs the linters, and verifies that code generation (`make generate`) has been run and the results have been committed.

Before making a commit, it's always a good idea to check the code for common programming mistakes, misspellings and other potential errors. The lint checks can be run by invoking the make lint task:

```shell
make lint
```
See `make help` for more information on other useful `make` targets.

### Local Development/Testing

It's very helpful to be able to test out changes to Contour locally without building images and pushing into clusters.
As an alternative to using `make install-contour-working` from above, you may prefer to be able to test out changes to Contour locally without building images and pushing into clusters.

To accomplish this, Envoy can be run inside a Kubernetes cluster, typically a `kind` cluster.
Then Contour is run on your local machine and Envoy will be configured to look for Contour running on your machine vs running in the cluster.
Expand Down

0 comments on commit 4e82e78

Please sign in to comment.