From 94269f41de7c12ad9a6c88a23bd6201eac80eff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Harper?= Date: Wed, 14 Aug 2024 10:42:56 -0400 Subject: [PATCH 1/2] docs: update the local testing to reflect latest changes in the process It's not new information, it should have been done a while ago. --- CONTRIBUTING.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7784739e..896a9eaa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,15 +25,33 @@ A [.devcontainer](https://containers.dev/) configuration is provided to allow fo ### Local development +#### The CLI + Kubefirst is created using the [Go Programming Language](https://go.dev). To set up your computer, follow [these steps](https://go.dev/doc/install). -Once Go is installed, you can run Kubefirst from any branch using `go run .`. Go will automatically install the needed modules listed in the [go.mod](go.mod) file. As an example, if you want to create a [local cluster](https://docs.kubefirst.io/kubefirst/local/install.html), the command would be `go run . k3d create`. Note that even if you run kubefirst from `main`, the [gitops-template](https://github.com/kubefirst/gitops-template) version used will be the [latest release](https://github.com/kubefirst/gitops-template/releases). If you also want to use the latest from `main` for the template also, you need to run to use the `--gitops-template-url`, and the `--gitops-template-branch` as follow: +Once Go is installed, you can run Kubefirst from any branch using `go run .`. Go will automatically install the needed modules listed in the [go.mod](go.mod) file. Since Go is a compiled programming language, every time you use the `run` command, Go will compile the code before running it. If you want to save time, you can compile your code using `go build`, which will generate a file named `kubefirst`. You will then be able to run your compiled version with the `./kubefirst` command. + +If you want to create a [Civo cluster](https://docs.kubefirst.io/kubefirst/local/install.html), the command would be `go run . civo create`. + +#### GitOps Template + +Note that even if you run kubefirst from `main`, the [gitops-template](https://github.com/kubefirst/gitops-template) version used will be the [latest release](https://github.com/kubefirst/gitops-template/releases). If you also want to use the latest from `main` for the template, you need to run to use the `--gitops-template-url`, and the `--gitops-template-branch` as follow: ```shell -go run . k3d create --gitops-template-url https://github.com/kubefirst/gitops-template --gitops-template-branch main +go run . civo create --gitops-template-url https://github.com/kubefirst/gitops-template --gitops-template-branch main +``` + +#### Kubefirst API + +If you need to use a specific branch or latest from `main` that wasn't released yet for the [kubefirst-api](https://github.com/kubefirst/kubefirst-api) repository, you will need to first run it locally as described in [its documentation](https://github.com/kubefirst/kubefirst-api#running-locally). You will also need to run the code from [console](https://github.com/kubefirst/console) repository, whether you need to use a specific version of the code or not, as we don't expose the API directly. To do so, follow the [instructions in its README](https://github.com/kubefirst/console#setup-instructions). + +The previous steps will work for all clouds except k3d which use our runtime for now: we have plan to remove this dependencies completely and use the API also to make the code easier to maintain, and less prone to issues. For that step, instead of running the API, and console locally, you simply need to clone the [kubefirst-api](https://github.com/kubefirst/kubefirst-api) repository locally, and add the following line in the `go.mod` file: + +```go +github.com/kubefirst/kubefirst-api vX.X.XX => /path-to/kubefirst-api/ ``` -Since Go is a compiled programming language, every time you use the `run` command, Go will compile the code before running it. If you want to save time, you can compile your code using `go build`, which will generate a file named `kubefirst`. You will then be able to run your compiled version with the `./kubefirst` command. +Replace `vX.X.XX` with the latest version used in the mode file for the API, and the `/path-to/kubefirst-api/` with the path to the folder of your locally Kubefirst API folder. ## Getting Started with the Documentation From d1b8266e26dbe0c14cfa021a93ea4bea0a9ae805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Harper?= Date: Wed, 14 Aug 2024 12:29:56 -0400 Subject: [PATCH 2/2] add the new environment variable --- CONTRIBUTING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 896a9eaa..02526f1a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,7 +43,11 @@ go run . civo create --gitops-template-url https://github.com/kubefirst/gitops-t #### Kubefirst API -If you need to use a specific branch or latest from `main` that wasn't released yet for the [kubefirst-api](https://github.com/kubefirst/kubefirst-api) repository, you will need to first run it locally as described in [its documentation](https://github.com/kubefirst/kubefirst-api#running-locally). You will also need to run the code from [console](https://github.com/kubefirst/console) repository, whether you need to use a specific version of the code or not, as we don't expose the API directly. To do so, follow the [instructions in its README](https://github.com/kubefirst/console#setup-instructions). +If you need to use a specific branch or latest from `main` that wasn't released yet for the [kubefirst-api](https://github.com/kubefirst/kubefirst-api) repository, you will need to first run it locally as described in [its documentation](https://github.com/kubefirst/kubefirst-api#running-locally). You will also need to run the code from [console](https://github.com/kubefirst/console) repository, whether you need to use a specific version of the code or not, as we don't expose the API directly. To do so, follow the [instructions in its README](https://github.com/kubefirst/console#setup-instructions). Before running the CLI as mentionned "The CLI" section, you need to export a local variable: + +```shell +export K1_CONSOLE_REMOTE_URL="http://localhost:3000" +``` The previous steps will work for all clouds except k3d which use our runtime for now: we have plan to remove this dependencies completely and use the API also to make the code easier to maintain, and less prone to issues. For that step, instead of running the API, and console locally, you simply need to clone the [kubefirst-api](https://github.com/kubefirst/kubefirst-api) repository locally, and add the following line in the `go.mod` file: