Skip to content

Commit

Permalink
Add chart-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dbast committed Jan 17, 2025
1 parent 492729d commit 6db18e1
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions recipes/chart-testing/activate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set "CT_CONFIG_DIR=%CONDA_PREFIX%\etc"
1 change: 1 addition & 0 deletions recipes/chart-testing/activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export CT_CONFIG_DIR="$CONDA_PREFIX/etc"
2 changes: 2 additions & 0 deletions recipes/chart-testing/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
go_compiler:
- go-nocgo
58 changes: 58 additions & 0 deletions recipes/chart-testing/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{% set goname = "github.com/helm/chart-testing" %}
{% set version = "3.12.0" %}

{% set name = goname.split('/')[-1] %}
{% set pkg_src = ('src/'+goname).replace("/",os.sep) %}

package:
name: {{ name|lower }}
version: {{ version|replace("-", "_") }}

source:
- folder: {{ pkg_src }}
url: https://{{ goname }}/archive/v{{ version }}.tar.gz
sha256: 129e380050ca79c6b89160475cb339da59067b6c36db85187ebbc50ea6b901d5

build:
number: 0
script:
- pushd {{ pkg_src }}
- go build -ldflags "-w -X github.com/helm/chart-testing/v3/ct/cmd.Version={{ version }}" -v -o $PREFIX/bin/ct ./ct # [not win]
- go build -ldflags "-w -X github.com/helm/chart-testing/v3/ct/cmd.Version={{ version }}" -v -o %LIBRARY_BIN%\ct.exe .\ct # [win]
- bash -c "mkdir ${PREFIX}/etc; cp -v ./etc/* ${PREFIX}/etc/"
- bash -c "mkdir -p ${PREFIX}/etc/conda/activate.d"
- bash -c "cp ${RECIPE_DIR}/activate.sh ${PREFIX}/etc/conda/activate.d/${PKG_NAME}.sh"
- bash -c "cp ${RECIPE_DIR}/activate.bat ${PREFIX}/etc/conda/activate.d/${PKG_NAME}.bat"
- go-licenses save ./ct --save_path ../../../../library_licenses
# Clear out cache to avoid file not removable warnings
- chmod -R u+w $(go env GOPATH) && rm -r $(go env GOPATH) # [unix]

requirements:
build:
- {{ compiler('go') }}
- go-licenses
run:
- yamllint
- yamale

test:
requires:
- kubernetes-helm
commands:
- ct version
- ct --help
- ct lint --help
- helm create testchart
- ct lint --charts ./testchart --validate-chart-schema=false --validate-maintainers=false

about:
home: https://{{ goname }}
license: Apache-2.0
license_file:
- {{ pkg_src }}/LICENSE
- library_licenses/
summary: CLI tool for linting and testing Helm charts

extra:
recipe-maintainers:
- dbast

0 comments on commit 6db18e1

Please sign in to comment.