Add support for Helm v3

This adds support for Helm v3.
- 'helm init' and initialization is no longer required
- 'chartmuseum' is used as a drop-in replacement for 'helm serv'
- all Charts require the tag: apiVersion: v1 (or v2)

Change-Id: I67769eb7c90b4cd07340434a769383fb8dbb30a7
Story: 2007000
Task: 39711
Depends-On: https://review.opendev.org/719962
Signed-off-by: Jim Gauld <james.gauld@windriver.com>
This commit is contained in:
Jim Gauld 2020-05-08 17:55:54 -04:00
parent 94d4c26f98
commit a781e39879
2 changed files with 6 additions and 42 deletions

View File

@ -22,6 +22,7 @@ BuildArch: noarch
Patch01: 0001-Patch-for-acmesolver.patch
BuildRequires: helm
BuildRequires: chartmuseum
%description
StarlingX Cert-Manager Helm Charts
@ -32,28 +33,9 @@ StarlingX Cert-Manager Helm Charts
%patch01 -p1
%build
# initialize helm and build the toolkit
# helm init --client-only does not work if there is no networking
# The following commands do essentially the same as: helm init
%define helm_home %{getenv:HOME}/.helm
mkdir %{helm_home}
mkdir %{helm_home}/repository
mkdir %{helm_home}/repository/cache
mkdir %{helm_home}/repository/local
mkdir %{helm_home}/plugins
mkdir %{helm_home}/starters
mkdir %{helm_home}/cache
mkdir %{helm_home}/cache/archive
# Stage a repository file that only has a local repo
cp %{SOURCE1} %{helm_home}/repository/repositories.yaml
# Stage a local repo index that can be updated by the build
cp %{SOURCE2} %{helm_home}/repository/local/index.yaml
# Host a server for the charts
helm serve --repo-path . &
helm repo rm local
chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" --storage-local-rootdir="." &
sleep 2
helm repo add local http://localhost:8879/charts
# Copy CRD yaml files to templates

View File

@ -22,6 +22,7 @@ Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: helm
BuildRequires: chartmuseum
BuildRequires: cert-manager-helm
Requires: cert-manager-helm
@ -32,28 +33,9 @@ StarlingX Cert-Manager Armada Helm Charts
%setup
%build
# initialize helm and build the toolkit
# helm init --client-only does not work if there is no networking
# The following commands do essentially the same as: helm init
%define helm_home %{getenv:HOME}/.helm
mkdir %{helm_home}
mkdir %{helm_home}/repository
mkdir %{helm_home}/repository/cache
mkdir %{helm_home}/repository/local
mkdir %{helm_home}/plugins
mkdir %{helm_home}/starters
mkdir %{helm_home}/cache
mkdir %{helm_home}/cache/archive
# Stage a repository file that only has a local repo
cp files/repositories.yaml %{helm_home}/repository/repositories.yaml
# Stage a local repo index that can be updated by the build
cp files/index.yaml %{helm_home}/repository/local/index.yaml
# Host a server for the charts
helm serve --repo-path . &
helm repo rm local
chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" --storage-local-rootdir="." &
sleep 2
helm repo add local http://localhost:8879/charts
# terminate helm server (the last backgrounded task)