From aea4bcf7262cf26a3d5a1f614b34510324645a1c Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Thu, 17 Dec 2020 14:28:11 -0600 Subject: [PATCH] Add helm3 linter for osh-addons This change adds a simple helm3 linting check job that will attempt to lint the charts in osh-addons with helm3. It will be non-voting for now. A future change will move this to osh-infra and use the job from there for the other repos. Change-Id: I716337005f977c6e936ce8c08ec24b20871f8284 --- tools/gate/playbooks/helm3-linter.yaml | 40 ++++++++++++++++++++++++++ zuul.d/jobs.yaml | 11 +++++++ zuul.d/project.yaml | 2 ++ 3 files changed, 53 insertions(+) create mode 100644 tools/gate/playbooks/helm3-linter.yaml diff --git a/tools/gate/playbooks/helm3-linter.yaml b/tools/gate/playbooks/helm3-linter.yaml new file mode 100644 index 00000000..3bbac17c --- /dev/null +++ b/tools/gate/playbooks/helm3-linter.yaml @@ -0,0 +1,40 @@ +--- +# 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. + +# TODO(gagehugo): Put this in osh-infra and run it from there + +- 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 + + - name: updates the requirements due to the lack of helm serve in helm 3 + shell: | + find "{{ zuul.project.src_dir }}" -type f -name "requirements.yaml" -exec sed -i "s#http://localhost:8879/charts#https://tarballs.opendev.org/openstack/openstack-helm-infra#g" {} \; + args: + executable: /bin/bash + + - name: make all + make: + chdir: "{{ zuul.project.src_dir }}" + target: all +... diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 2d6d22b0..41cf1613 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -35,6 +35,17 @@ - openstack/openstack-helm nodeset: openstack-helm-single-node +- job: + name: osh-helm3-linter + nodeset: ubuntu-focal + run: tools/gate/playbooks/helm3-linter.yaml + required-projects: + - openstack/openstack-helm-infra + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ + - job: name: osh-addons-sonobuoy parent: osh-addons-base diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index e8865757..1a4a3613 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -15,6 +15,8 @@ check: jobs: - openstack-helm-lint + - osh-helm3-linter: + voting: false - osh-addons-sonobuoy - osh-addons-ranger - osh-addons-mini-mirror