diff --git a/.github/workflows/risu.yml b/.github/workflows/risu.yml new file mode 100644 index 000000000..bfddcba45 --- /dev/null +++ b/.github/workflows/risu.yml @@ -0,0 +1,29 @@ +name: Run Risu analysis + +on: + push: + # branches: + # - main + # schedule: + # - cron: '0 0 * * *' + +jobs: + risu: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + + # Use GitHub Actions' cache to shorten build times and decrease load on servers + - uses: actions/cache@v2.1.6 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/*') }} + restore-keys: | + ${{ runner.os }}-pip- + + - uses: risuorg/gh-action-risu@1.2.0 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + SOSREPORT: ./validations/test + CONFIGPATH: "./" + RUNFILE: "./validations/build.sh" diff --git a/test-requirements.txt b/test-requirements.txt index 416634f52..a91da5773 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1 +1,2 @@ pre-commit +risu diff --git a/validations/build.sh b/validations/build.sh new file mode 100644 index 000000000..a9bf588e2 --- /dev/null +++ b/validations/build.sh @@ -0,0 +1 @@ +#!/bin/bash diff --git a/validations/core/check_managedcluster.sh b/validations/core/check_managedcluster.sh new file mode 100755 index 000000000..b37ab8023 --- /dev/null +++ b/validations/core/check_managedcluster.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright (C) 2022 Pablo Iranzo Gómez +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# long_name: Checks if managed cluster has been detached +# description: Checks managed cluster +# priority: 900 +# bugzilla: + +# Load common functions +[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh" + +FILE="${KUBECONFIG}" +is_mandatory_file ${FILE} + +MANA=$(oc get managedcluster --no-headers | grep -v local-cluster) + +if [ $(echo ${MANA} | wc -l) == 0 ]; then + # No managed clusters found + exit ${RC_OKAY} +else + echo -e "Managed clusters found:\n ${MANA}" >&2 + exit ${RC_ERROR} +fi diff --git a/validations/profiles/ZTPFW-validations.txt b/validations/profiles/ZTPFW-validations.txt new file mode 100644 index 000000000..535797ff1 --- /dev/null +++ b/validations/profiles/ZTPFW-validations.txt @@ -0,0 +1,12 @@ +# Author: Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com) + +# Copyright (C) 2020 Pablo Iranzo Gómez +# description: Checks ZTPFW Validations results +# long_name: ZTPFW Validations +# +# Defines which plugins to include, exclude, etc +# Syntax +# +keyword : includes keyword in plugin search +# -keyword : excludes keyword in plugin search + ++validations diff --git a/validations/test/.placeholder b/validations/test/.placeholder new file mode 100644 index 000000000..e69de29bb diff --git a/website/validations/.placeholder b/website/validations/.placeholder new file mode 100644 index 000000000..e69de29bb