]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gitlab-ci: Add CentOS 9 Stream
authorAndreas Schneider <asn@samba.org>
Fri, 7 Jun 2024 12:16:28 +0000 (14:16 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 13 Jun 2024 12:25:37 +0000 (12:25 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
.gitlab-ci-main.yml
bootstrap/.gitlab-ci.yml
bootstrap/config.py
bootstrap/generated-dists/Vagrantfile
bootstrap/generated-dists/centos9s/Dockerfile [new file with mode: 0644]
bootstrap/generated-dists/centos9s/bootstrap.sh [new file with mode: 0755]
bootstrap/generated-dists/centos9s/locale.sh [new file with mode: 0755]
bootstrap/generated-dists/centos9s/packages.yml [new file with mode: 0644]
bootstrap/sha1sum.txt

index 30838f44bd261b336cafa8acd25649b273fab00a..d076a77cf17bedb640ea2c875dad6c23bcf9adff 100644 (file)
@@ -47,7 +47,7 @@ variables:
   # Set this to the contents of bootstrap/sha1sum.txt
   # which is generated by bootstrap/template.py --render
   #
-  SAMBA_CI_CONTAINER_TAG: 0698e9cba84190b97adb8313ff63bd36922fb7bc
+  SAMBA_CI_CONTAINER_TAG: 3e791f1081a27f9462da4db20f186c9eaf592500
   #
   # We use the ubuntu2204 image as default as
   # it matches what we have on atb-devel-224
@@ -66,6 +66,7 @@ variables:
   SAMBA_CI_CONTAINER_IMAGE_opensuse155: opensuse155
   SAMBA_CI_CONTAINER_IMAGE_fedora39: fedora39
   SAMBA_CI_CONTAINER_IMAGE_centos8s: centos8s
+  SAMBA_CI_CONTAINER_IMAGE_centos9s: centos9s
 
 include:
   # The image creation details are specified in a separate file
@@ -667,6 +668,11 @@ centos8s-samba-o3:
   variables:
     SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_centos8s}
 
+centos9s-samba-o3:
+  extends: .samba-o3-template
+  variables:
+    SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_centos9s}
+
 fedora39-samba-o3:
   extends: .samba-o3-template
   variables:
index 697e95a6029c4b36bac72d4fe5aabf07a8424617..7f281b9ab60a1c99ff045dad5b01a535a62d39c5 100644 (file)
@@ -109,5 +109,8 @@ debian11-32bit:
 centos8s:
   extends: .build_image_template
 
+centos9s:
+  extends: .build_image_template
+
 opensuse155:
   extends: .build_image_template
index f6340fb8266f4e2d1d7e7c1f03bdfc7dcc77e3bf..56d1d3d4bdeccce69a96d29d30498fdce16a12e3 100644 (file)
@@ -260,6 +260,28 @@ yum install -y \
 yum clean all
 """
 
+CENTOS9S_DNF_BOOTSTRAP = r"""
+#!/bin/bash
+{GENERATED_MARKER}
+set -xueo pipefail
+
+dnf update -y
+dnf install -y dnf-plugins-core
+dnf install -y epel-release
+dnf install -y centos-release-gluster9
+
+dnf -v repolist all
+dnf config-manager --set-enabled crb -y
+
+dnf update -y
+
+dnf install -y \
+    --setopt=install_weak_deps=False \
+    {pkgs}
+
+dnf clean all
+"""
+
 DNF_BOOTSTRAP = r"""
 #!/bin/bash
 {GENERATED_MARKER}
@@ -503,6 +525,25 @@ RPM_DISTS = {
             'codespell': '',
         }
     },
+    'centos9s': {
+        'docker_image': 'quay.io/centos/centos:stream9',
+        'vagrant_box': 'centos/stream9',
+        'bootstrap': CENTOS9S_DNF_BOOTSTRAP,
+        'replace': {
+            'lsb-release': 'lsb_release',
+            '@development-tools': '"@Development Tools"',  # add quotes
+            'lcov': '', # does not exist
+            'perl-JSON-Parse': '', # does not exist?
+            'perl-Test-Base': 'perl-Test-Simple',
+            'perl-FindBin': '',
+            'mold': '',
+            'ShellCheck': '',
+            'shfmt': '',
+            'codespell': '',
+            'libcephfs-devel': '',  # not available anymore
+            'curl': '',  # Use installed curl-minimal
+        }
+    },
     'fedora39': {
         'docker_image': 'quay.io/fedora/fedora:39',
         'vagrant_box': 'fedora/39-cloud-base',
index 980bd79bb8919f9c85c28bba53866ac2954c7d26..d9b28d9dcfd88f2a7598c109d5a6cc89bcfe04ef 100644 (file)
@@ -17,6 +17,13 @@ Vagrant.configure("2") do |config|
         v.vm.provision :shell, path: "centos8s/locale.sh"
     end
 
+    config.vm.define "centos9s" do |v|
+        v.vm.box = "centos/stream9"
+        v.vm.hostname = "centos9s"
+        v.vm.provision :shell, path: "centos9s/bootstrap.sh"
+        v.vm.provision :shell, path: "centos9s/locale.sh"
+    end
+
     config.vm.define "debian11" do |v|
         v.vm.box = "debian/bullseye64"
         v.vm.hostname = "debian11"
diff --git a/bootstrap/generated-dists/centos9s/Dockerfile b/bootstrap/generated-dists/centos9s/Dockerfile
new file mode 100644 (file)
index 0000000..42324ad
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+FROM quay.io/centos/centos:stream9
+
+# pass in with --build-arg while build
+ARG SHA1SUM
+RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
+
+ADD *.sh /tmp/
+# need root permission, do it before USER samba
+RUN /tmp/bootstrap.sh && /tmp/locale.sh
+
+# if ld.gold exists, force link it to ld
+RUN set -x; ! LD_GOLD=$(which ld.gold) || { LD=$(which ld) && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"; }
+# if ld.mold exists, force link it to ld (prefer mold over gold! ;-)
+RUN set -x; ! LD_MOLD=$(which ld.mold) || { LD=$(which ld) && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD"; }
+
+# make test can not work with root, so we have to create a new user
+RUN useradd -m -U -s /bin/bash samba && \
+    mkdir -p /etc/sudoers.d && \
+    echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
+
+USER samba
+WORKDIR /home/samba
+# samba tests rely on this
+ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8 LANGUAGE=en_US
\ No newline at end of file
diff --git a/bootstrap/generated-dists/centos9s/bootstrap.sh b/bootstrap/generated-dists/centos9s/bootstrap.sh
new file mode 100755 (executable)
index 0000000..40894b3
--- /dev/null
@@ -0,0 +1,125 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+dnf update -y
+dnf install -y dnf-plugins-core
+dnf install -y epel-release
+dnf install -y centos-release-gluster9
+
+dnf -v repolist all
+dnf config-manager --set-enabled crb -y
+
+dnf update -y
+
+dnf install -y \
+    --setopt=install_weak_deps=False \
+    "@Development Tools" \
+    acl \
+    attr \
+    autoconf \
+    avahi-devel \
+    bind-utils \
+    binutils \
+    bison \
+    ccache \
+    chrpath \
+    crypto-policies-scripts \
+    cups-devel \
+    dbus-devel \
+    docbook-dtds \
+    docbook-style-xsl \
+    flex \
+    gawk \
+    gcc \
+    gdb \
+    git \
+    glib2-devel \
+    glibc-common \
+    glibc-langpack-en \
+    glusterfs-api-devel \
+    glusterfs-devel \
+    gnutls-devel \
+    gnutls-utils \
+    gpgme-devel \
+    gzip \
+    hostname \
+    htop \
+    jansson-devel \
+    jq \
+    keyutils-libs-devel \
+    krb5-devel \
+    krb5-server \
+    krb5-workstation \
+    libacl-devel \
+    libarchive-devel \
+    libattr-devel \
+    libblkid-devel \
+    libbsd-devel \
+    libcap-devel \
+    libicu-devel \
+    libpcap-devel \
+    libtasn1-devel \
+    libtasn1-tools \
+    libtirpc-devel \
+    libunwind-devel \
+    liburing-devel \
+    libuuid-devel \
+    libxslt \
+    lmdb \
+    lmdb-devel \
+    lsb_release \
+    make \
+    mingw64-gcc \
+    ncurses-devel \
+    openldap-devel \
+    pam-devel \
+    patch \
+    perl \
+    perl-Archive-Tar \
+    perl-ExtUtils-MakeMaker \
+    perl-Parse-Yapp \
+    perl-Test-Simple \
+    perl-generators \
+    perl-interpreter \
+    pkgconfig \
+    popt-devel \
+    procps-ng \
+    psmisc \
+    python3 \
+    python3-cryptography \
+    python3-devel \
+    python3-dns \
+    python3-gpg \
+    python3-iso8601 \
+    python3-libsemanage \
+    python3-markdown \
+    python3-policycoreutils \
+    python3-pyasn1 \
+    python3-requests \
+    python3-setproctitle \
+    quota-devel \
+    readline-devel \
+    rng-tools \
+    rpcgen \
+    rpcsvc-proto-devel \
+    rsync \
+    sed \
+    sudo \
+    systemd-devel \
+    tar \
+    tracker-devel \
+    tree \
+    wget \
+    which \
+    xfsprogs-devel \
+    xz \
+    yum-utils \
+    zlib-devel
+
+dnf clean all
\ No newline at end of file
diff --git a/bootstrap/generated-dists/centos9s/locale.sh b/bootstrap/generated-dists/centos9s/locale.sh
new file mode 100755 (executable)
index 0000000..cc64e18
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# This file is generated by 'bootstrap/template.py --render'
+# See also bootstrap/config.py
+#
+
+set -xueo pipefail
+
+# refer to /usr/share/i18n/locales
+INPUTFILE=en_US
+# refer to /usr/share/i18n/charmaps
+CHARMAP=UTF-8
+# locale to generate in /usr/lib/locale
+# glibc/localedef will normalize UTF-8 to utf8, follow the naming style
+LOCALE=$INPUTFILE.utf8
+
+# if locale is already correct, exit
+( locale | grep LC_ALL | grep -i $LOCALE ) && exit 0
+
+# if locale not available, generate locale into /usr/lib/locale
+if ! ( locale --all-locales | grep -i $LOCALE )
+then
+    # no-archive means create its own dir
+    localedef --inputfile $INPUTFILE --charmap $CHARMAP --no-archive $LOCALE
+fi
+
+# update locale conf and global env file
+# set both LC_ALL and LANG for safe
+
+# update conf for Debian family
+FILE=/etc/default/locale
+if [ -f $FILE ]
+then
+    echo LC_ALL="$LOCALE" > $FILE
+    echo LANG="$LOCALE" >> $FILE
+fi
+
+# update conf for RedHat family
+FILE=/etc/locale.conf
+if [ -f $FILE ]
+then
+    # LC_ALL is not valid in this file, set LANG only
+    echo LANG="$LOCALE" > $FILE
+fi
+
+# update global env file
+FILE=/etc/environment
+if [ -f $FILE ]
+then
+    # append LC_ALL if not exist
+    grep LC_ALL $FILE || echo LC_ALL="$LOCALE" >> $FILE
+    # append LANG if not exist
+    grep LANG $FILE || echo LANG="$LOCALE" >> $FILE
+fi
\ No newline at end of file
diff --git a/bootstrap/generated-dists/centos9s/packages.yml b/bootstrap/generated-dists/centos9s/packages.yml
new file mode 100644 (file)
index 0000000..19b480e
--- /dev/null
@@ -0,0 +1,104 @@
+---
+packages:
+  - "@Development Tools"
+  - acl
+  - attr
+  - autoconf
+  - avahi-devel
+  - bind-utils
+  - binutils
+  - bison
+  - ccache
+  - chrpath
+  - crypto-policies-scripts
+  - cups-devel
+  - dbus-devel
+  - docbook-dtds
+  - docbook-style-xsl
+  - flex
+  - gawk
+  - gcc
+  - gdb
+  - git
+  - glib2-devel
+  - glibc-common
+  - glibc-langpack-en
+  - glusterfs-api-devel
+  - glusterfs-devel
+  - gnutls-devel
+  - gnutls-utils
+  - gpgme-devel
+  - gzip
+  - hostname
+  - htop
+  - jansson-devel
+  - jq
+  - keyutils-libs-devel
+  - krb5-devel
+  - krb5-server
+  - krb5-workstation
+  - libacl-devel
+  - libarchive-devel
+  - libattr-devel
+  - libblkid-devel
+  - libbsd-devel
+  - libcap-devel
+  - libicu-devel
+  - libpcap-devel
+  - libtasn1-devel
+  - libtasn1-tools
+  - libtirpc-devel
+  - libunwind-devel
+  - liburing-devel
+  - libuuid-devel
+  - libxslt
+  - lmdb
+  - lmdb-devel
+  - lsb_release
+  - make
+  - mingw64-gcc
+  - ncurses-devel
+  - openldap-devel
+  - pam-devel
+  - patch
+  - perl
+  - perl-Archive-Tar
+  - perl-ExtUtils-MakeMaker
+  - perl-Parse-Yapp
+  - perl-Test-Simple
+  - perl-generators
+  - perl-interpreter
+  - pkgconfig
+  - popt-devel
+  - procps-ng
+  - psmisc
+  - python3
+  - python3-cryptography
+  - python3-devel
+  - python3-dns
+  - python3-gpg
+  - python3-iso8601
+  - python3-libsemanage
+  - python3-markdown
+  - python3-policycoreutils
+  - python3-pyasn1
+  - python3-requests
+  - python3-setproctitle
+  - quota-devel
+  - readline-devel
+  - rng-tools
+  - rpcgen
+  - rpcsvc-proto-devel
+  - rsync
+  - sed
+  - sudo
+  - systemd-devel
+  - tar
+  - tracker-devel
+  - tree
+  - wget
+  - which
+  - xfsprogs-devel
+  - xz
+  - yum-utils
+  - zlib-devel
\ No newline at end of file
index 6cb838fcdff23e3be986aa49df9cf91d0c3d9d31..6482772ca4acf0b51aaafe35320c57835574aa22 100644 (file)
@@ -1 +1 @@
-0698e9cba84190b97adb8313ff63bd36922fb7bc
+3e791f1081a27f9462da4db20f186c9eaf592500