Skip to content

Commit

Permalink
chore(pkg): updates the chart packaging
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stannum-l committed Oct 17, 2020
1 parent a282491 commit e5c776e
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 41 additions & 0 deletions playbooks/build-chart.yaml
Original file line number Diff line number Diff line change
@@ -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:https://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:https://localhost:8879/charts#file:https://../helm-toolkit#g" {} \;
args:
executable: /bin/bash

- name: make all
make:
chdir: "{{ zuul.project.src_dir }}"
target: all
params:
TASK: package
...
13 changes: 11 additions & 2 deletions playbooks/publish/post.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://../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:
Expand Down
4 changes: 3 additions & 1 deletion zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e5c776e

Please sign in to comment.