Fix: Skip sigul installation on Ubuntu 50/72950/3 v0.90.9
authorAnil Belur <abelur@linuxfoundation.org>
Sun, 9 Jun 2024 23:37:08 +0000 (09:37 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Mon, 10 Jun 2024 07:31:19 +0000 (17:31 +1000)
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 <abelur@linuxfoundation.org>
releasenotes/notes/skip-sigul-on-ubuntu--c8070cceaa577da1.yaml [new file with mode: 0644]
shell/sigul-install.sh
shell/sigul-sign-dir.sh

diff --git a/releasenotes/notes/skip-sigul-on-ubuntu--c8070cceaa577da1.yaml b/releasenotes/notes/skip-sigul-on-ubuntu--c8070cceaa577da1.yaml
new file mode 100644 (file)
index 0000000..26ceefe
--- /dev/null
@@ -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.
index 08b3b7d..c340e6f 100755 (executable)
@@ -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
index d3995ac..2d44cdf 100644 (file)
@@ -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/"\