Skip to content

Commit

Permalink
Added the local development setup guide (#168)
Browse files Browse the repository at this point in the history
* added the local dev setup guide

Signed-off-by: deep-poharkar <[email protected]>

* fixed the link

Signed-off-by: deep-poharkar <[email protected]>

* removed unwanted settings for litmusconfig

Signed-off-by: deep-poharkar <[email protected]>

---------

Signed-off-by: deep-poharkar <[email protected]>
  • Loading branch information
deep-poharkar authored Feb 10, 2024
1 parent 3bac6d7 commit bed5b0c
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 10 deletions.
87 changes: 87 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -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 <command> <subcommand> <subcommand> [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! 🚀🔥
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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: <a href="https://github.com/litmuschaos/litmusctl/blob/master/Usage_0.23.0.md">Click here</a>
* For v0.12.0 to v0.22.0: <a href="https://github.com/litmuschaos/litmusctl/blob/master/Usage_interactive.md">Click here</a>
* For v0.2.0 or earlier && compatible with Litmus-2.0.0-Beta8 or earlier: <a href="https://github.com/litmuschaos/litmusctl/blob/master/Usage_v0.2.0.md">Click here</a>
Expand All @@ -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

Expand Down Expand Up @@ -185,44 +187,48 @@ To install the latest version of litmusctl follow the below steps:

### Linux/MacOS

* Extract the binary
- Extract the binary

```shell
tar -zxvf litmusctl-<OS>-<ARCH>-<VERSION>.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 <command> <subcommand> <subcommand> [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 <command> <subcommand> <subcommand> [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).

---

0 comments on commit bed5b0c

Please sign in to comment.