From 7482b2720dc51e454bfad870d3ccdebbc11a12d2 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Mon, 10 Jun 2024 09:37:08 +1000 Subject: [PATCH] Fix: Skip sigul installation on Ubuntu Skip sigul installation on Ubuntu, since the CentOS docker container handles the installation during container creation. Issue: RELENG-5419 Change-Id: I716f4f36d90ddad648725ccbe9f8d48a74abd549 Signed-off-by: Anil Belur --- releasenotes/notes/skip-sigul-on-ubuntu--c8070cceaa577da1.yaml | 8 ++++++++ shell/sigul-install.sh | 6 ++++++ shell/sigul-sign-dir.sh | 6 ++++-- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/skip-sigul-on-ubuntu--c8070cceaa577da1.yaml diff --git a/releasenotes/notes/skip-sigul-on-ubuntu--c8070cceaa577da1.yaml b/releasenotes/notes/skip-sigul-on-ubuntu--c8070cceaa577da1.yaml new file mode 100644 index 00000000..26ceefea --- /dev/null +++ b/releasenotes/notes/skip-sigul-on-ubuntu--c8070cceaa577da1.yaml @@ -0,0 +1,8 @@ +--- +issues: + - | + Sigul install is available only on CentOS based patforms. +fixes: + - | + Skip sigul installation on Ubuntu, since the CentOS docker container handles + the installation during container creation. diff --git a/shell/sigul-install.sh b/shell/sigul-install.sh index 08b3b7d8..c340e6f1 100755 --- a/shell/sigul-install.sh +++ b/shell/sigul-install.sh @@ -13,6 +13,12 @@ echo "---> sigul-install.sh" # Ensure we fail the job if any steps fail. set -e -o pipefail +OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') +if ! [[ "${OS}" =~ ^(fedora|centos|redhat) ]]; then + echo "INFO: Skip step, sigul install not available on platform ${OS}" + exit 0 +fi + if command -v sigul &>/dev/null; then echo "Sigul already installed; skipping installation." else diff --git a/shell/sigul-sign-dir.sh b/shell/sigul-sign-dir.sh index d3995ace..2d44cdf6 100644 --- a/shell/sigul-sign-dir.sh +++ b/shell/sigul-sign-dir.sh @@ -19,8 +19,10 @@ set -e -o pipefail lf-activate-venv --python python3 lftools OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') -OS_RELEASE=$(facter lsbdistrelease | tr '[:upper:]' '[:lower:]') -if [[ "$OS_RELEASE" == "8" && "$OS" == 'centos' ]]; then +OS_DIST_RELEASE=$(facter lsbdistrelease | tr '[:upper:]' '[:lower:]') +OS_RELEASE=$(facter operatingsystemrelease | tr '[:upper:]' '[:lower:]') +if [[ "$OS_DIST_RELEASE" == "8" && "${OS}" =~ ^(fedora|centos|redhat)$ ]] || \ + [[ "$OS_RELEASE" =~ ^(20.04|22.04)$ && "${OS}" =~ ^(ubuntu|debian)$ ]]; then # Get Dockerfile and the enterpoint to build the docker image. # shellcheck disable=SC2140 wget -O "${WORKSPACE}/sigul-sign.sh" "https://raw.githubusercontent.com/"\ -- 2.16.6