diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 141d8d1682..ae8af9b58c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,7 @@ [CNCF Code of Conduct]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md [Kubernetes Community Membership]: https://github.com/kubernetes/community/blob/master/community-membership.md +[Kustomize Architecture]: ARCHITECTURE.md [Contribution Guide]: https://kubectl.docs.kubernetes.io/contributing/kustomize/ [MacOS Dev Guide]: https://kubectl.docs.kubernetes.io/contributing/kustomize/mac/ [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 ## Getting Started -Dev guides: - -- [Contribution Guide] -- [MacOS Dev Guide] -- [Windows Dev Guide] - -General resources for contributors: +### Forking Kustomize and Working Locally +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. + +### Create a fork in GitHub +1. Visit https://github.com/kubernetes-sigs/kustomize +2. Click the `Fork` button on the top right + +### Clone the repository +```bash +# Clone your repository fork from the previous step +git clone --recurse-submodules git@github.com:/kustomize.git +cd kustomize + +# Configure upstream +git remote add upstream https://github.com/kubernetes-sigs/kustomize +git remote set-url --push upstream no_push + +# Review git configuration +git remote -v +``` + +### Create a working branch +```bash +# Fetch changes from upstream master +cd kustomize +git fetch upstream +git checkout master +git rebase upstream/master + +# Create your working branch +git checkout -b myfeature +``` + +### Sync your working branch +You will need to periodically fetch changes from the `upstream` repository to keep your working branch in sync. +```bash +cd kustomize +git fetch upstream +git checkout myfeature +git rebase upstream/master +``` + +### Push to GitHub +When your changes are ready for review, push your working branch to your fork on GitHub. +```bash +cd kustomize +git push origin myfeature +``` + +### Create a Pull Request +1. Visit your fork at `https://github.com//kustomize` +2. Click the **Compare & Pull Request** button next to your `myfeature` branch. +3. Check out the pull request [process](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md) for more details and advice. + +If you ran `git push` in the previous step, GitHub will return a useful link to create a Pull Request. + + +### Build Kustomize +The [Kustomize Architecture] document describes the respository organization and the kustomize build process. +```bash +# For go version >= 1.13 +unset GOPATH +unset GO111MODULES + +# Build kustomize binary and install in go bin path +cd kustomize +make kustomize + +# Run unit tests +make test-unit-all + +# Run linter +make lint + +# Test examples against HEAD +make test-examples-kustomize-against-HEAD + +# Run your development version +~/go/bin/kustomize version +``` + +### General resources for contributors - [Contributor License Agreement] - Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests. - [Kubernetes Contributor Guide] - Main contributor documentation.