Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
*~
.idea

# Built binaries
chartify
chartreposerver

# testdata
testdata/kustomize_with_helm_charts/charts/
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
.PHONY: all
all: build

.PHONY: build
build: build-chartify build-chartreposerver

.PHONY: build-chartify
build-chartify:
go build -o chartify ./cmd/chartify

.PHONY: build-chartreposerver
build-chartreposerver:
go build -o chartreposerver ./cmd/chartreposerver

.PHONY: install
install:
go install ./cmd/chartify
go install ./cmd/chartreposerver

.PHONY: clean
clean:
rm -f chartify chartreposerver

.PHONY: test
test:
go test ./...
Expand Down
108 changes: 106 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,118 @@

`chartify` is intended to be run immediately before running `helm upgrade --install`. For example, instead of forking a helm chart, you should be able to prepend a `chartify` step into your deployment job in your CD pipeline. `chartify` isn't intended to create a fork of a chart. The output of `chartify` is a helm chart that is pre-rendered with all the helm values provided to `chartify`.

## Prerequisites

- Go 1.24.0 or later
- Helm 3.x (required for chart operations)

## Building and Installation

### Building from Source

To build the binaries locally:

```bash
# Build both chartify and chartreposerver binaries
make build

# Or build them individually
make build-chartify
make build-chartreposerver

# Clean up built binaries
make clean
```

### Installing

To install the binaries to your `$GOPATH/bin`:

```bash
make install
```

Or install directly with Go:

```bash
go install github.com/helmfile/chartify/cmd/chartify@latest
go install github.com/helmfile/chartify/cmd/chartreposerver@latest
```

## CLI

Beyond it's usage with helmfile, it also provides a basic CLI application that can be run independently.

### chartify

The simplest usage of the command is:

```
```bash
$ chartify $RELEASE $CHART -o $OUTPUT_DIR
```

See `chartify -h` or `go run ./cmd/chartify -h` for more information.
#### Examples

Convert a local chart:
```bash
$ ./chartify myrelease ./my-chart -o ./output
```

Convert with additional dependencies:
```bash
$ ./chartify myrelease ./my-chart -o ./output -d "redis=redis:6.0.0"
```

Include CRDs in the output:
```bash
$ ./chartify myrelease ./my-chart -o ./output --include-crds
```

Apply a strategic merge patch:
```bash
$ ./chartify myrelease ./my-chart -o ./output --strategic-merge-patch ./patch.yaml
```

#### Full Usage

See `chartify -h` or `go run ./cmd/chartify -h` for more information:

```
Usage of chartify:
-d value
one or more "alias=chart:version" to add adhoc chart dependencies
-f string
The path to the input file or stdout(-) (default "-")
-include-crds
Whether to render CRDs contained in the chart and include the results into the output
-o string
The path to the output directory (required)
-strategic-merge-patch string
Path to a kustomize strategic merge patch file
```

### chartreposerver

A simple chart repository server for development and testing:

```bash
$ ./chartreposerver /path/to/charts/directory
```

The server will start on port 18080 and serve charts from the specified directory.

## Development

### Running Tests

```bash
# Run all tests
make test

# Run tests with verbose output and retain temp directories
make test/verbose
```

### Linting

This project uses golangci-lint. The configuration is in `.golangci.yaml`.