From bed5b0c77546d28aababa505fe0a9addb930d31d Mon Sep 17 00:00:00 2001 From: Deep Poharkar <91543514+deep-poharkar@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:17:16 +0530 Subject: [PATCH] Added the local development setup guide (#168) * added the local dev setup guide Signed-off-by: deep-poharkar * fixed the link Signed-off-by: deep-poharkar * removed unwanted settings for litmusconfig Signed-off-by: deep-poharkar --------- Signed-off-by: deep-poharkar --- DEVELOPMENT.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 26 +++++++++------ 2 files changed, 103 insertions(+), 10 deletions(-) create mode 100644 DEVELOPMENT.md diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 00000000..17871a68 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,87 @@ +# Litmusctl Local Development Setup Guide + +## Introduction + +Welcome to the local development setup guide for **`litmusctl`**. This guide will walk you through the steps required to set up and run **`litmusctl`** on your local machine. + +## Important Note + +Before running **`litmusctl`**, make sure you have a Chaos Centre running. Ensure that the Chaos Centre version is compatible with the **`litmusctl`** version you are using. + +## Prerequisites + +Before you begin, ensure that you have the following prerequisites installed on your machine: + +- [Go programming language](https://golang.org/doc/install) (version or later) +- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +- Kubeconfig - `litmusctl` needs the kubeconfig of the k8s cluster where we need to connect litmus Chaos Delegates. The CLI currently uses the default path of kubeconfig i.e. `~/.kube/config`. + +## Clone the Repository + +```bash +git clone https://github.com/litmuschaos/litmusctl.git + +cd litmusctl +``` + +## **Install Dependencies** + +```bash +go mod download +``` + +## **Configuration** + +Before running **`litmusctl`**, update the following configuration paths in the **`pkg/utils/constants.go`** + +From this + +```go +// Graphql server API path +GQLAPIPath = "/api/query" + +// Auth server API path +AuthAPIPath = "/auth" +``` + +To this + +```go +// Graphql server API path +GQLAPIPath = "/query" + +// Auth server API path +AuthAPIPath = "" +``` + +## **Running `litmusctl`** + +Execute the following command to run **`litmusctl`** locally: + +```bash +go run main.go [options and parameters] +``` + +## **Testing `litmusctl`** + +To run tests, use the following command: + +```bash +go test ./... +``` + +## **Contributing Guidelines** + +If you wish to contribute to **`litmusctl`**, please follow our [contributing guidelines](https://github.com/litmuschaos/litmus/blob/master/CONTRIBUTING.md). Your contributions are valuable, and adhering to these guidelines ensures a smooth and collaborative development process. + +## **Troubleshooting** + +If you encounter any issues during setup, refer to our [troubleshooting guide](https://docs.litmuschaos.io/docs/troubleshooting) or reach out to our community for assistance. We're here to help you overcome any obstacles and ensure a successful setup. + +## **Additional Information** + +For more details on using **`litmusctl`**, refer to our [official documentation](https://docs.litmuschaos.io/). This documentation provides comprehensive information to help you make the most out of **`litmusctl`**. + +Thank you for setting up **`litmusctl`** locally! Feel free to explore and contribute to the project. Your involvement is crucial to the success of the **`litmusctl`** community. + +Let the chaos begin! 🚀🔥 diff --git a/README.md b/README.md index 25ac9ae8..36cb5182 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Litmusctl + [![BCH compliance](https://bettercodehub.com/edge/badge/litmuschaos/litmusctl?branch=master)](https://bettercodehub.com/) ![GitHub Workflow](https://github.com/litmuschaos/litmusctl/actions/workflows/push.yml/badge.svg?branch=master) [![GitHub stars](https://img.shields.io/github/stars/litmuschaos/litmusctl?style=social)](https://github.com/litmuschaos/litmusctl/stargazers) @@ -7,7 +8,9 @@ The Litmuschaos command-line tool, litmusctl, allows you to manage litmuschaos's agent plane. You can use litmusctl to connect Chaos Delegates, create project, schedule Chaos Scenarios, disconnect Chaos Delegates and manage multiple litmuschaos accounts. ## Usage + For more information including a complete list of litmusctl operations, see the litmusctl reference documentation. + * For 0.23.0 or latest: Click here * For v0.12.0 to v0.22.0: Click here * For v0.2.0 or earlier && compatible with Litmus-2.0.0-Beta8 or earlier: Click here @@ -17,8 +20,7 @@ For more information including a complete list of litmusctl operations, see the The litmusctl CLI requires the following things: - kubeconfig - litmusctl needs the kubeconfig of the k8s cluster where we need to connect litmus Chaos Delegates. The CLI currently uses the default path of kubeconfig i.e. `~/.kube/config`. -- kubectl- litmusctl is using kubectl under the hood to apply the manifest. To install kubectl, follow: [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) - +- kubectl- litmusctl is using kubectl under the hood to apply the manifest. To install kubectl, follow: [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) ## Compatibility matrix @@ -185,25 +187,25 @@ To install the latest version of litmusctl follow the below steps: ### Linux/MacOS -* Extract the binary +- Extract the binary ```shell tar -zxvf litmusctl---.tar.gz ``` -* Provide necessary permissions +- Provide necessary permissions ```shell chmod +x litmusctl ``` -* Move the litmusctl binary to /usr/local/bin/litmusctl. Note: Make sure to use root user or use sudo as a prefix +- Move the litmusctl binary to /usr/local/bin/litmusctl. Note: Make sure to use root user or use sudo as a prefix ```shell mv litmusctl /usr/local/bin/litmusctl ``` -* You can run the litmusctl command in Linux/macOS: +- You can run the litmusctl command in Linux/macOS: ```shell litmusctl [options and parameters] @@ -211,18 +213,22 @@ litmusctl [options and parameters] ### Windows -* Extract the binary from the zip using WinZip or any other extraction tool. +- Extract the binary from the zip using WinZip or any other extraction tool. -* You can run the litmusctl command in windows: +- You can run the litmusctl command in windows: ```shell litmusctl.exe [options and parameters] ``` -* To check the version of the litmusctl: +- To check the version of the litmusctl: ```shell litmusctl version ``` ----- +## Development Guide + +You can find the local setup guide for **`litmusctl`** [here](DEVELOPMENT.md). + +---