Skip to content

Commit

Permalink
docs: README.md and CONTRIBUTING.md
Browse files Browse the repository at this point in the history
Initial project documentation front page.
  • Loading branch information
otaviof committed Jul 10, 2024
1 parent a7d41e0 commit 7482c5a
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 0 deletions.
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Contributing to `rhtap-cli`
---------------------------

In order to contribute to this project you need the following requirements:

- [Golang 1.16 or higher][golang]
- [GNU Make][gnuMake]

All the automation needed for the project lives in the [Makefile](Makefile). This file is the entry point for all the automation task in the project for CI, development and release

# Building

After you have cloned the repository and installed the requirements, you can start building. For that purpose you can simply run `make`, the default target builds the application on the `bin` directory

```bash
make
```

# Testing

Unit testing is done using the `go test` command, you can run the tests with the following target:

```bash
make test-unit
```

Alternatively run all tests with:

```bash
make test
```

# Running

To run the application you can rely on the `run` target, this is the equivalent of `go run` command. For instance:

```bash
make run ARGS='deploy --help'
```

Which is the equivalent of:

```bash
make &&
bin/rhtap-cli deploy --help
```

[gnuMake]: https://www.gnu.org/software/make/
[golang]: https://golang.org/dl/
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Red Hat Trusted Application Pipeline Instaler (`rhtap-cli`)
-----------------------------------------------------------

# Overview

The `rhtap-cli` is designed as a sophisticated installer for Kubernetes [Helm Charts][helm], addressing the complexity of managing interdependent resources in Kubernetes environments. Unlike Kubernetes, which orchestrates resources individually without acknowledging their interdependencies, `rhtap-cli` enhances the deployment process by considering these relationships, thereby improving the user experience.

This CLI leverages a [`config.yaml`](config.yaml) file to sequence Helm Chart deployments meticulously. It ensures the integrity of each deployment phase by executing a comprehensive test suite before proceeding to the next Chart installation. This methodical approach guarantees that each phase is successfully completed, enhancing reliability and stability.

Helm, serving as the foundation of `rhtap-cli`, provides a detailed blueprint of resources within Kubernetes. This allows for thorough inspection and troubleshooting of deployment issues, offering users detailed documentation and tips for resolution. By integrating with Helm Charts, `rhtap-cli` not only adheres to industry standards but also opens the door to more sophisticated features, further enriching the deployment experience.

The `rhtap-cli` is designed to be user-friendly, providing a seamless installation process for users of all skill levels.

# Configuration Overview

The `config.yaml` file is structured to outline key components essential for the setup:

```yaml
---
rhtapCLI:
namespace: rhtap
features: {}
dependencies: {}
```
The attributes of the `rhtapCLI` object are as follows:

- `.namespace`: Specifies the default namespace used by the installer, set to rhtap. This namespace acts as the primary operational area for the installation process.
- `.features`: Defines the features to be deployed by the installer. Each feature is identified by a unique name and a set of properties.
- `.dependencies`: Specifies the dependencies rolled out by the installer in the specific order defined in the configuration file.

## `rhtapCLI.features`

Defines the features the installer will deploy. Each feature is defined by a unique name and a set of properties. For instance, the following snippet defines a `featureName` block:

```yaml
---
rhtapCLI:
features:
featureName:
enabled: true
namespace: namespace
properties:
key: value
```

With the following attributes:
- `enabled`: A boolean value to toggle the unique feature
- `namespace`: The namespace in which the feature will be deployed
- `properties`: A set of key-value pairs to define the feature's properties

This data can be leveraged for templating using the [`values.yaml.tpl`](#template-functions) file.

## `rhtapCLI.dependencies`

```yaml
rhtapCLI:
dependencies:
- chart: path/to/chart/directory
namespace: namespace
enabled: true
```

# Template Functions

The following functions are available for use in the `values.yaml.tpl` file:

## `{{ .Installer.Features.* }}`

- `{{ .Installer.Features.*.Enabled }}`: Returns the boolean value of the feature's `enabled` field.
- `{{ .Installer.Features.*.Namespace }}`: Returns the namespace in which the feature will be deployed.
- `{{ .Installer.Features.*.Properties.*}}`: Returns a dictionary of key-value pairs for the feature's properties.

## `{{ .OpenShift.Ingress }}`

Helper function to inspect the target cluster's Ingress configuration.

```yaml
{{- $ingressDomain := required "OpenShift ingress domain" .OpenShift.Ingress.Domain -}}
---
developerHub:
ingressDomain: {{ $ingressDomain }}
```

# Contributing

Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information on contributing to this project.


[helm]: https://helm.sh/

0 comments on commit 7482c5a

Please sign in to comment.