[master] 0ede556cc circleci: Add almalinux:8 jobs for el8

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Mar 14 14:56:04 UTC 2022


commit 0ede556cc941249091e7e7bd16e179befaf9e96f
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Mar 14 14:02:57 2022 +0100

    circleci: Add almalinux:8 jobs for el8
    
    And while at it, make it easier to work with distribution names with
    less if statements and more case matching.
    
    Better diff with the --ignore-all-space option.

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 9707e08f1..7ce929b8b 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -161,6 +161,7 @@ jobs:
             case "<< parameters.platform >>" in
                 debian:*|ubuntu:*)  EXT=deb ;;
                 centos:*|fedora:*)  EXT=rpm ;;
+                almalinux:*)        EXT=rpm ;;
                 alpine:*)           EXT=apk ;;
                 *)
                     echo "unrecognized platform: << parameters.platform >>"
@@ -225,16 +226,20 @@ jobs:
             docker create --name workspace -v /workspace << parameters.prefix >><< parameters.dist >>:<< parameters.release >> /bin/true
             docker cp /workspace workspace:/
             docker run --volumes-from workspace -w /workspace << parameters.prefix >><< parameters.dist >>:<< parameters.release >> sh -c '
-            if [ << parameters.dist >> = centos -o << parameters.dist >> = fedora ]; then
+            case "<< parameters.dist >>" in
+            centos|almalinux|fedora)
                 yum groupinstall -y "Development Tools"
-                if [ << parameters.dist >> = centos ]; then
-                    if [ << parameters.release >> = stream ]; then
+                case "<< parameters.dist >>:<< parameters.release >>" in
+                    centos:stream|almalinux:8)
                         dnf install -y "dnf-command(config-manager)"
                         yum config-manager --set-enabled powertools
                         yum install -y diffutils
-                    fi
-                    yum install -y epel-release
-                fi
+                        yum install -y epel-release
+                        ;;
+                    centos:7)
+                        yum install -y epel-release
+                        ;;
+                esac
                 yum install -y \
                     cpio \
                     automake \
@@ -248,7 +253,8 @@ jobs:
                     python3 \
                     /usr/bin/sphinx-build \
                     sudo
-            elif [ << parameters.dist >> = debian -o << parameters.dist >> = ubuntu ]; then
+                ;;
+            debian|ubuntu)
                 export DEBIAN_FRONTEND=noninteractive
                 export DEBCONF_NONINTERACTIVE_SEEN=true
                 apt-get update
@@ -269,7 +275,8 @@ jobs:
                     pkg-config \
                     python3-sphinx \
                     sudo
-            elif [ << parameters.dist >> = alpine ]; then
+                ;;
+            alpine)
                 apk update
                 apk add -q \
                     autoconf \
@@ -288,7 +295,8 @@ jobs:
                     py3-sphinx \
                     tar \
                     sudo
-            elif [ << parameters.dist >> = archlinux ]; then
+                ;;
+            archlinux)
                 pacman -Syu --noconfirm \
                     ca-certificates \
                     cpio \
@@ -301,15 +309,20 @@ jobs:
                     python-docutils \
                     python-sphinx \
                     tar
-            fi
+                ;;
+            esac
 
-            if [ << parameters.dist >> = archlinux ]; then
+            case "<< parameters.dist >>" in
+            archlinux)
                 useradd varnish
-            elif [ << parameters.dist >> = centos -o << parameters.dist >> = fedora ]; then
-            	adduser varnish
-            else
-            	adduser --disabled-password --gecos "" varnish
-            fi
+                ;;
+            centos|almalinux|fedora)
+                adduser varnish
+                ;;
+            *)
+                adduser --disabled-password --gecos "" varnish
+                ;;
+            esac
 
             chown -R varnish:varnish .
 
@@ -360,6 +373,10 @@ workflows:
           prefix: quay.io/centos/
           dist: centos
           release: stream
+      - distcheck:
+          name: distcheck_almalinux_8
+          dist: almalinux
+          release: "8"
       - distcheck:
           name: distcheck_fedora_latest
           dist: fedora
@@ -413,6 +430,7 @@ workflows:
                 - debian:stretch
                 - centos:7
                 - centos:stream
+                - almalinux:8
                 - fedora:latest
                 - alpine:3
               rclass:
diff --git a/.circleci/make-rpm-packages.sh b/.circleci/make-rpm-packages.sh
index 40c883d98..566fbc2ca 100755
--- a/.circleci/make-rpm-packages.sh
+++ b/.circleci/make-rpm-packages.sh
@@ -13,13 +13,16 @@ elif [ -z "$PARAM_DIST" ]; then
     exit 1
 fi
 
-if [ "$PARAM_DIST" = centos ]; then
-    if [ "$PARAM_RELEASE" = stream ]; then
+case "$PARAM_DIST:$PARAM_RELEASE" in
+    centos:stream|almalinux:8)
         dnf install -y 'dnf-command(config-manager)'
         yum config-manager --set-enabled powertools
-    fi
-    yum install -y epel-release
-fi
+        yum install -y epel-release
+        ;;
+    centos:7)
+        yum install -y epel-release
+        ;;
+esac
 
 yum install -y rpm-build yum-utils
 


More information about the varnish-commit mailing list