From 44bc8c60fd7f99e76fe056381eab93a99709125f Mon Sep 17 00:00:00 2001 From: Yordis Prieto Lazo Date: Thu, 1 Jun 2023 14:52:36 -0400 Subject: [PATCH] chore: improve contributing readme closes #78 --- .gitignore | 1 + INSTALL.md | 4 ++-- Makefile | 4 ++++ docs/CONTRIBUTING.md | 43 ++++++++++++++++++++++++++++++++++++------- 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 9cbe7fe..b8e23c6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ tilt-settings.json tild.d/ tilt_modules/ cluster/local/provider.Tiltfile +tmp/ diff --git a/INSTALL.md b/INSTALL.md index 613b8ba..dd3265d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -15,7 +15,7 @@ The following tools are need on the host: * docker (1.12+) or Docker for Mac (17+) * git * make -* golang +* golang (v1.18) * rsync (if you're using the build container on mac) * helm (v2.8.2+) * kubebuilder (v1.0.4+) @@ -97,4 +97,4 @@ For example, if you'd like to spin up a DigitalOcean Droplet, run the command ```console kubectl apply -f examples/compute ``` -and check your DigitalOcean account to see if the Droplet has been created. \ No newline at end of file +and check your DigitalOcean account to see if the Droplet has been created. diff --git a/Makefile b/Makefile index ba17194..e58400a 100644 --- a/Makefile +++ b/Makefile @@ -93,6 +93,10 @@ crds.clean: @find $(CRD_DIR) -name *.yaml.sed -delete || $(FAIL) @$(OK) cleaned generated CRDs +crds.install: + @$(INFO) Installing Provider DigitalOcean CRDs + @$(KUBECTL) apply -f $(CRD_DIR) -R + generate: crds.clean manifests: diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 808cf90..78b6359 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,11 +1,40 @@ -# Local Environment Setup +# Contributing -We have included some makefile targets to ease the local development process. You will need the following tools installed to get started. +We have included some makefile targets to ease the local development process. You will need the following tools +installed to get started. -- [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/) -- [Kubectl](https://kubernetes.io/docs/tasks/tools/) -- [Crossplane CLI](https://crossplane.io/docs/v1.4/getting-started/install-configure.html#install-crossplane-cli) (Not required, but suggested) +## How-Tos -You can then run `make` which will build the project and setup the build submodule. Once this is finished you can then run `make dev` which will boot up a kind cluster, install Crossplane, any CRDs for the project, and then start the provider. +### Getting Started -You can run `make dev-clean` to then cleanup the cluster, or `make dev-restart` which will run the `dev-clean` and then the `dev` targets. +1. Install [Kind][0]. +2. Install [Kubectl][1]. +3. Install [Crossplane CLI][2] (Not required, but suggested). +4. Install `go` version `1.18`. +5. Run `make submodules` to initialize the submodules. +6. Run `make`. +7. Run `make dev-kind` to start the cluster and install the provider. +8. Run `make dev-provider` to start the provider controller. +9. Rerun `make dev-provider` to restart the provider controller. + +## Explanations + +### Makefile + +#### Working with the cluster + +- `make dev-clean` destroy the `kind` cluster. +- `make dev-kind` will start the `kind` cluster and install `Crossplane` and any `CRDs` for the project. +- `make dev-provider` will start the provider controller. +- `make dev` will run `dev-kind` and `dev-provider`. + +#### Working with CRDs + +- `make crds.clean` will remove all `CRDs` from the cluster. +- `make crds.install` will install all `CRDs` from the project. + +[0]: https://kind.sigs.k8s.io/docs/user/quick-start/ + +[1]: https://kubernetes.io/docs/tasks/tools/ + +[2]: https://docs.crossplane.io/v1.10/getting-started/install-configure#install-crossplane-cli