Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chart-testing #28859

Merged
merged 1 commit into from
Jan 20, 2025
Merged
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
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
Loading