Skip to content

Commit 90cdfd4

Browse files
bobcatfishbalopat
authored andcommitted
Add DEVELOPMENT.md (GoogleContainerTools#901)
* Add DEVELOPMENT.md This DEVELOPMENT.md will hopefully help folks ramp up and get started contributing to skaffold by describing the development process. After discussions with @r2d4 and @balopat we want to try out keeping the contributor/developer docs in markdown, while the user facing docs will continue to be in asciidoc. One of the reasons for this is that github will automatically link to the CONTRIBUTING.md and code of conduct, and so if we wrote this in ascii doc, we would _have_ to make the docs (and any references, links, etc.) that they contain work for both markdown view in github and ascii doctor view in the generated docs. * Explain how docs are published
1 parent dd9fb3c commit 90cdfd4

File tree

5 files changed

+160
-18
lines changed

5 files changed

+160
-18
lines changed

CONTRIBUTING.adoc CONTRIBUTING.md

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1+
# How to Contribute
12

2-
= How to Contribute
33
We'd love to accept your patches and contributions to this project. There are
44
just a few small guidelines you need to follow.
55

6-
== Contributor License Agreement
6+
When you are ready to get started developing, see
7+
[DEVELOPMENT.md](./DEVELOPMENT.md) for how to get started!
8+
9+
## Contributor License Agreement
710

811
Contributions to this project must be accompanied by a Contributor License
912
Agreement. You (or your employer) retain the copyright to your contribution,
1013
this simply gives us permission to use and redistribute your contributions as
11-
part of the project. Head over to <https://cla.developers.google.com/> to see
14+
part of the project. Head over to
15+
[https://cla.developers.google.com/](https://cla.developers.google.com) to see
1216
your current agreements on file or to sign a new one.
1317
You generally only need to submit a CLA once, so if you've already submitted one
1418
(even if it was for a different project), you probably don't need to do it
1519
again.
1620

17-
== Code reviews
18-
All submissions, including submissions by project members, require review. We
19-
use GitHub pull requests for this purpose. Consult
20-
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
21-
information on using pull requests.
22-
23-
== Contributing to documentation
24-
Contributing to docs is the same process as the code reviews - except that we recommend that you locally you can check the generated docs with
25-
```
26-
make docs
27-
```
28-
And then open the generated docs/generated folder for `index.html` and `index.pdf`.
21+
## Code reviews
2922

23+
All submissions, including submissions by project members, require review. We
24+
use GitHub pull requests for this purpose. Consult the developer docs for more
25+
info on [creating pull requests](DEVELOPMENT.md#creating-a-pr)
26+
and [the Skaffold review process](DEVELOPMENT.md#reviews).

DEVELOPMENT.md

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Development
2+
3+
This doc explains the development workflow so you can get started
4+
[contributing](CONTRIBUTING.md) to Skaffold!
5+
6+
## Getting started
7+
8+
First you will need to setup your GitHub account and create a fork:
9+
10+
1. Create [a GitHub account](https://github.com/join)
11+
1. Setup [GitHub access via
12+
SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
13+
1. [Create and checkout a repo fork](#checkout-your-fork)
14+
15+
Once you have those, you can iterate on skaffold:
16+
17+
1. [Build your dev version of skaffold](#building-skaffold)
18+
1. [Verify changes locally](#verifying-local-changes)
19+
1. [Run skaffold tests](#testing-skaffold)
20+
1. [Build docs](#building-skaffold-docs) if you are making doc changes
21+
22+
When you're ready, you can [create a PR](#creating-a-pr)!
23+
24+
You may also be interested in [contributing to the docs](#contributing-to-skaffold-docs).
25+
26+
## Checkout your fork
27+
28+
The Go tools require that you clone the repository to the `src/github.com/GoogleContainerTools/skaffold` directory
29+
in your [`GOPATH`](https://github.com/golang/go/wiki/SettingGOPATH).
30+
31+
To check out this repository:
32+
33+
1. Create your own [fork of this
34+
repo](https://help.github.com/articles/fork-a-repo/)
35+
36+
1. Clone it to your machine:
37+
38+
```shell
39+
mkdir -p ${GOPATH}/src/github.com/GoogleContainerTools
40+
cd ${GOPATH}/src/github.com/GoogleContainerTools
41+
git clone [email protected]:${YOUR_GITHUB_USERNAME}/skaffold.git
42+
cd skaffold
43+
git remote add upstream [email protected]:GoogleContainerTools/skaffold.git
44+
git remote set-url --push upstream no_push
45+
```
46+
47+
_Adding the `upstream` remote sets you up nicely for regularly [syncing your
48+
fork](https://help.github.com/articles/syncing-a-fork/)._
49+
50+
## Building skaffold
51+
52+
To build with your local changes you have two options:
53+
54+
1. Build the skaffold binary:
55+
56+
```shell
57+
make
58+
./out/skaffold version
59+
```
60+
61+
You can then run this binary directly, or copy/symlink it into your path.
62+
63+
1. Build and install the skaffold binary:
64+
65+
```shell
66+
make install
67+
skaffold version
68+
```
69+
70+
This will install skaffold via `go install` (note that if you have [manually downloaded
71+
and installed skaffold to `/usr/bin/local`](README.adoc#installation), this is will probably
72+
take precedence in your path over your `$GOPATH/bin`).
73+
74+
_If you are unsure if you are running a released or locally built version of skaffold, you
75+
can run `skaffold version` - output which includes `dirty` indicates you have built the
76+
binary locally._
77+
78+
## Verifying local changes
79+
80+
If you are iterating on skaffold and want to see your changes in action, you can:
81+
82+
1. [Build skaffold](#building-and-running-skaffold)
83+
2. [Use the quickstart example](README.adoc#iterative-development)
84+
85+
## Testing skaffold
86+
87+
skaffold has both [unit tests](#unit-tests) and [integration tests](#integration-tests).
88+
89+
### Unit Tests
90+
91+
The unit tests live with the code they test and can be run with:
92+
93+
```shell
94+
make test
95+
```
96+
97+
_These tests will not run correctly unless you have [checked out your fork into your `$GOPATH`](#checkout-your-fork)._
98+
99+
### Integration tests
100+
101+
The integration tests live in [`integration`](./integration) and run the [`examples`](./examples)
102+
as tests. They can be run with:
103+
104+
```shell
105+
make integration-test
106+
```
107+
108+
_These tests require push access to a project in GCP, and so can only be run
109+
by maintainers who have access. These tests will be kicked off by [reviewers](#reviews)
110+
for submitted PRs._
111+
112+
## Building skaffold docs
113+
114+
Before [creating a PR](#creating-a-pr) with doc changes, we recommend that you locally verify the
115+
generated docs with:
116+
117+
```shell
118+
make docs
119+
```
120+
121+
And then open the generated docs/generated folder for `index.html` and `index.pdf`.
122+
123+
Once PRs with doc changes are merged, they will get automatically published to the docs
124+
for [the latest build](https://storage.googleapis.com/skaffold/builds/latest/docs/index.html)
125+
which at release time will be published with [the latest release](https://storage.googleapis.com/skaffold/releases/latest/docs/index.html).
126+
127+
## Creating a PR
128+
129+
When you have changes you would like to propose to skaffold, you will need to:
130+
131+
1. Ensure the commit message(s) describe what issue you are fixing and how you are fixing it
132+
(include references to [issue numbers](https://help.github.com/articles/closing-issues-using-keywords/)
133+
if appropriate)
134+
1. [Create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)
135+
136+
### Reviews
137+
138+
Each PR must be reviewed by a maintainer. This maintainer will add the `kokoro:run` label
139+
to a PR to kick of [the integration tests](#integration-tests), which must pass for the PR
140+
to be submitted.

README.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ git clone https://github.com/GoogleContainerTools/skaffold
108108
[source,shell]
109109
cd examples/getting-started
110110

111-
. Run `skaffold dev`.
111+
. Replace `k8s-project` with your GCP project ID.
112112

113+
. Run `skaffold dev`.
113114
[source,console]
114115
$ skaffold dev
115116
Starting build...

docs/index.adoc

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ include::../examples/README.adoc[]
4545

4646
= Contributing
4747

48-
include::../CONTRIBUTING.adoc[leveloffset=+1]
48+
See http://github.com/GoogleContainerTools/skaffold/tree/master/CONTRIBUTING.md[CONTRIBUTING.md]
49+
50+
== Development
51+
52+
See http://github.com/GoogleContainerTools/skaffold/tree/master/DEVELOPMENT.md[DEVELOPMENT.md]
4953

5054
== Code of conduct
5155

examples/README.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
== Examples
22
:icons: font
33

4-
To run any of the examples, just replace `k8s-project` with your GCP project ID.
4+
To run any of the examples, replace `k8s-project` with your GCP project ID.
55

66
ifndef::env-github[]
77

0 commit comments

Comments
 (0)