Skip to content

Commit e7c8ed1

Browse files
authored
Add contributor guide (#5426)
* Add contributor guide * git merge upstream/master * git rebase upstream/master * make test-unit-all * make lint
1 parent b844368 commit e7c8ed1

File tree

1 file changed

+83
-7
lines changed

1 file changed

+83
-7
lines changed

CONTRIBUTING.md

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
[CNCF Code of Conduct]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md
1414
[Kubernetes Community Membership]: https://github.com/kubernetes/community/blob/master/community-membership.md
1515

16+
[Kustomize Architecture]: ARCHITECTURE.md
1617
[Contribution Guide]: https://kubectl.docs.kubernetes.io/contributing/kustomize/
1718
[MacOS Dev Guide]: https://kubectl.docs.kubernetes.io/contributing/kustomize/mac/
1819
[Windows Dev Guide]: https://kubectl.docs.kubernetes.io/contributing/kustomize/windows/
@@ -25,13 +26,88 @@ _As contributors and maintainers of this project, and in the interest of fosteri
2526

2627
## Getting Started
2728

28-
Dev guides:
29-
30-
- [Contribution Guide]
31-
- [MacOS Dev Guide]
32-
- [Windows Dev Guide]
33-
34-
General resources for contributors:
29+
### Forking Kustomize and Working Locally
30+
The Kustomize project uses a "Fork and Pull" workflow that is standard to GitHub. In git terms, your personal fork is referred to as the "origin" and the actual project's git repository is called "upstream". To keep your personal branch (origin) up to date with the project (upstream), it must be configured within your local working copy.
31+
32+
### Create a fork in GitHub
33+
1. Visit https://github.com/kubernetes-sigs/kustomize
34+
2. Click the `Fork` button on the top right
35+
36+
### Clone the repository
37+
```bash
38+
# Clone your repository fork from the previous step
39+
git clone --recurse-submodules [email protected]:<your github username>/kustomize.git
40+
cd kustomize
41+
42+
# Configure upstream
43+
git remote add upstream https://github.com/kubernetes-sigs/kustomize
44+
git remote set-url --push upstream no_push
45+
46+
# Review git configuration
47+
git remote -v
48+
```
49+
50+
### Create a working branch
51+
```bash
52+
# Fetch changes from upstream master
53+
cd kustomize
54+
git fetch upstream
55+
git checkout master
56+
git rebase upstream/master
57+
58+
# Create your working branch
59+
git checkout -b myfeature
60+
```
61+
62+
### Sync your working branch
63+
You will need to periodically fetch changes from the `upstream` repository to keep your working branch in sync.
64+
```bash
65+
cd kustomize
66+
git fetch upstream
67+
git checkout myfeature
68+
git rebase upstream/master
69+
```
70+
71+
### Push to GitHub
72+
When your changes are ready for review, push your working branch to your fork on GitHub.
73+
```bash
74+
cd kustomize
75+
git push origin myfeature
76+
```
77+
78+
### Create a Pull Request
79+
1. Visit your fork at `https://github.com/<user>/kustomize`
80+
2. Click the **Compare & Pull Request** button next to your `myfeature` branch.
81+
3. Check out the pull request [process](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md) for more details and advice.
82+
83+
If you ran `git push` in the previous step, GitHub will return a useful link to create a Pull Request.
84+
85+
86+
### Build Kustomize
87+
The [Kustomize Architecture] document describes the respository organization and the kustomize build process.
88+
```bash
89+
# For go version >= 1.13
90+
unset GOPATH
91+
unset GO111MODULES
92+
93+
# Build kustomize binary and install in go bin path
94+
cd kustomize
95+
make kustomize
96+
97+
# Run unit tests
98+
make test-unit-all
99+
100+
# Run linter
101+
make lint
102+
103+
# Test examples against HEAD
104+
make test-examples-kustomize-against-HEAD
105+
106+
# Run your development version
107+
~/go/bin/kustomize version
108+
```
109+
110+
### General resources for contributors
35111

36112
- [Contributor License Agreement] - Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests.
37113
- [Kubernetes Contributor Guide] - Main contributor documentation.

0 commit comments

Comments
 (0)