From 887327aff844cdfe693129f925525d661478f3fb Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 11 Sep 2020 11:19:53 -0400 Subject: [PATCH] Publish Helm charts into tarballs.openstack.org This will start publishing all of the charts into tarballs.openstack.org which should allow for easier public consumption of these charts. This patch covers adding publishing for openstack-helm-infra first. Change-Id: Iaa14629c0d0c36b98c2295119af3008f14c0cd39 --- playbooks/publish/post.yaml | 42 +++++++++++++++++++++++++++++++++++++ playbooks/publish/run.yaml | 20 ++++++++++++++++++ zuul.d/jobs.yaml | 6 ++++++ zuul.d/project.yaml | 3 +++ 4 files changed, 71 insertions(+) create mode 100644 playbooks/publish/post.yaml create mode 100644 playbooks/publish/run.yaml diff --git a/playbooks/publish/post.yaml b/playbooks/publish/post.yaml new file mode 100644 index 000000000..49816e615 --- /dev/null +++ b/playbooks/publish/post.yaml @@ -0,0 +1,42 @@ +--- +# Copyright 2020 VEXXHOST, Inc. +# +# 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: Download current index + register: _get_url + failed_when: _get_url.status_code not in (200, 404) + get_url: + url: https://tarballs.opendev.org/openstack/openstack-helm/index.yaml + dest: "{{ zuul.project.src_dir }}/index.yaml" + + - name: Create a new index + when: _get_url.status_code == 404 + + - 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 + + - name: Update Helm repository + synchronize: + mode: pull + src: "{{ zuul.project.src_dir }}" + dest: "{{ zuul.executor.work_root }}/artifacts/" + verify_host: true + rsync_opts: + - "--include=index.yaml" + - "--include=*.tgz" + - "--exclude=*" +... diff --git a/playbooks/publish/run.yaml b/playbooks/publish/run.yaml new file mode 100644 index 000000000..50d0695cf --- /dev/null +++ b/playbooks/publish/run.yaml @@ -0,0 +1,20 @@ +--- +# Copyright 2020 VEXXHOST, Inc. +# +# 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 + roles: + - name: build-helm-packages + work_dir: "{{ zuul.project.src_dir }}" +... diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 97e22ec00..400c52560 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -25,6 +25,12 @@ - ^doc/.*$ - ^releasenotes/.*$ +- job: + name: publish-openstack-helm-charts + parent: publish-openstack-artifacts + run: playbooks/publish/run.yaml + post-run: playbooks/publish/post.yaml + - job: name: openstack-helm-infra-functional run: playbooks/osh-infra-gate-runner.yaml diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 034d2a45c..763bf19c5 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -41,6 +41,9 @@ - openstack-helm-infra-aio-logging - openstack-helm-infra-aio-monitoring - openstack-helm-infra-openstack-support + post: + jobs: + - publish-openstack-helm-charts # NOTE(srwilkers): Disabling all periodic and experimental jobs until # issues with the kubeadm-aio based deployments are addressed periodic: