chore(pkg): updates the chart packaging

This patch set updates the ability to package (and subsequent publish)
of the charts in the OpenStack-Helm-Infra repository.

Change-Id: I6175325b0e7a668c22a7ec3ab08cae51ad4f9ab8
Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
Tin Lam 2020-10-17 02:22:04 -05:00
parent a282491ba6
commit e5c776e5c4
4 changed files with 61 additions and 3 deletions

View File

@ -38,6 +38,12 @@ lint-%: init-%
build-%: lint-%
if [ -d $* ]; then $(HELM) package $*; fi
# Note: user running helm3 can package the charts, but can run into helm lint
# issue due to stricter logic in helm3. This adds a target to package charts
# without executing a lint until the issues are fixed.
package-%: init-%
if [ -d $* ]; then $(HELM) package $*; fi
clean:
@echo "Removed .b64, _partials.tpl, and _globals.tpl files"
rm -f helm-toolkit/secrets/*.b64

View File

@ -0,0 +1,41 @@
---
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- hosts: all
tasks:
- name: install helm3
become_user: root
shell: |
TMP_DIR=$(mktemp -d)
curl -sSL https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar -zxv --strip-components=1 -C ${TMP_DIR}
sudo mv ${TMP_DIR}/helm /usr/bin/helm
rm -rf ${TMP_DIR}
environment:
HELM_VERSION: "v3.3.4"
args:
executable: /bin/bash
# Note: This needs to be adjusted once the initial tarball is seeded.
- name: updates the requirements due to the lack of helm serve in helm 3
shell: |
find . -type f -name "requirements.yaml" -exec sed -i "s#http://localhost:8879/charts#file://../helm-toolkit#g" {} \;
args:
executable: /bin/bash
- name: make all
make:
chdir: "{{ zuul.project.src_dir }}"
target: all
params:
TASK: package
...

View File

@ -24,11 +24,20 @@
- name: Create a new index
when: _get_url.status_code == 404
shell: helm repo index {{ zuul.project.src_dir }}
shell: helm repo index {{ zuul.project.src_dir }} --url https://tarballs.opendev.org/openstack/openstack-helm-infra
- name: Merge into existing index
when: _get_url.status_code == 200
shell: helm repo index {{ zuul.project.src_dir }} --merge {{ zuul.project.src_dir }}/index.yaml
shell: helm repo index {{ zuul.project.src_dir }} --merge {{ zuul.project.src_dir }}/index.yaml --url https://tarballs.opendev.org/openstack/openstack-helm-infra
# TODO: Remove this once HTK is seeded in tarballs.o.o
- name: Update the HTK dependencies
shell: |
sed -i 's#file://../helm-toolkit#https://tarballs.opendev.org/openstack/openstack-helm-infra#g' index.yaml
chdir:
args:
executable: /bin/bash
chdir: "{{ zuul.project.src_dir }}"
- name: Update Helm repository
synchronize:

View File

@ -28,7 +28,9 @@
- job:
name: publish-openstack-helm-charts
parent: publish-openstack-artifacts
run: playbooks/publish/run.yaml
run: playbooks/build-chart.yaml
required-projects:
- openstack/openstack-helm-infra
post-run: playbooks/publish/post.yaml
- job: