Skip to content

Commit

Permalink
CI:
Browse files Browse the repository at this point in the history
- check only major number of target release for upgraded system
- code clean up
  • Loading branch information
yuravk committed Nov 20, 2024
1 parent 65b680c commit 5745bbd
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions .github/workflows/elevate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AlmaLinux ELevete
name: AlmaLinux ELevate

on:
workflow_dispatch:
Expand Down Expand Up @@ -92,8 +92,6 @@ jobs:
scenario: '9'

env:
version8_minor: 10
version9_minor: 4
vm_serial_log: '/var/log/elevatevm_consoles/serial.log'
vm_boot_timeout: 600

Expand All @@ -111,47 +109,43 @@ jobs:
8)
variant=el7toel8
source_release=7
minor_version=${{ env.version8_minor }}
source_distro=centos
[ "${{ matrix.distro }}" = "scientific" ] && source_distro=scientific
;;
9)
variant=el8toel9
source_release=8
minor_version=${{ env.version9_minor }}
source_distro=${{ matrix.distro }}
;;
esac
target_distro=${{ matrix.distro }}
target_release="${{ matrix.scenario }}.${minor_version}"
# Target system release file, string and Vagrant image
target_release_file=/etc/${{ matrix.distro }}-release
case ${{ matrix.distro }} in
almalinux|scientific )
vm_box=almalinux/${source_release}
target_distro=almalinux
target_release_string="AlmaLinux release ${target_release}"
target_release_string="AlmaLinux release ${{ matrix.scenario }}"
target_release_file=/etc/almalinux-release
;;
centos )
vm_box=eurolinux-vagrant/centos-stream-${source_release} # generic/centos8s
target_release_string="CentOS Stream release ${{ matrix.scenario }}"
target_release=${{ matrix.scenario }}
;;
eurolinux )
vm_box=eurolinux-vagrant/eurolinux-${source_release}
target_release_string="EuroLinux release ${target_release}"
target_release_string="EuroLinux release ${{ matrix.scenario }}"
target_release_file=/etc/el-release
;;
oraclelinux )
vm_box=eurolinux-vagrant/oracle-linux-${source_release} # generic/oracle8
target_release_string="Oracle Linux Server release ${target_release}"
target_release_string="Oracle Linux Server release ${{ matrix.scenario }}"
target_release_file=/etc/oracle-release
;;
rocky )
vm_box=eurolinux-vagrant/rocky-${source_release} # generic/rocky8
target_release_string="Rocky Linux release ${target_release}"
target_release_string="Rocky Linux release ${{ matrix.scenario }}"
;;
esac
if [ "${source_release}" = "7" ]; then
Expand All @@ -164,7 +158,6 @@ jobs:
echo "target_release_string=${target_release_string}" >> $GITHUB_ENV
echo "target_release_file=${target_release_file}" >> $GITHUB_ENV
echo "source_release=${source_release}" >> $GITHUB_ENV
echo "target_release=${target_release}" >> $GITHUB_ENV
echo "source_distro=${source_distro}" >> $GITHUB_ENV
echo "target_distro=${target_distro}" >> $GITHUB_ENV
echo "variant_long=${source_distro}${source_release}-to-${target_distro}${{ matrix.scenario }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -283,17 +276,17 @@ jobs:
EOF
chmod +x ELevate.sh
- name: Create Verndors.sh
- name: Create Vendors.sh
run: |
# The script install Vendors
cat << 'EOF'> Verndors.sh
cat << 'EOF'> Vendors.sh
#!/bin/bash
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_COLLATE=C
export LC_CTYPE=en_US.UTF-8
# Verdor name to install, one of: 'epel', 'kernelcare', 'imunify', ...
# Vendor name to install, one of: 'epel', 'kernelcare', 'imunify', ...
vendor=$1
# Source system release number: '7', '8', ...
source_release=$2
Expand Down Expand Up @@ -355,7 +348,7 @@ jobs:
if [ "${vendor}" = "mariadb" ]; then
# MariaDB server requires some packages from EPEL on EL7
if [ "${source_release}" = "7" ]; then
if [ "${source_release}" = "7" ]; then
sudo dnf -y -q install epel-release
fi
Expand Down Expand Up @@ -410,7 +403,7 @@ jobs:
exit ${res}
EOF
chmod +x Verndors.sh
chmod +x Vendors.sh
- name: Create leapp-data-rpm.sh
run: |
Expand All @@ -435,7 +428,7 @@ jobs:
/bin/cp -a /vagrant/* ${rpmbuild_topdir}/SOURCES/${name}-${version}/
/bin/cp /vagrant/leapp-data.spec ${rpmbuild_topdir}/SPECS/
# Exclude some files generated by the workflow
rm -f ${rpmbuild_topdir}/SOURCES/${name}-${version}/{ELevate.sh,Verndors.sh,leapp-data-rpm.sh}
rm -f ${rpmbuild_topdir}/SOURCES/${name}-${version}/{ELevate.sh,Vendors.sh,leapp-data-rpm.sh}
cd ${rpmbuild_topdir}/SOURCES/ && tar zcf ${source} ${name}-${version}
# Build and install the package
Expand Down Expand Up @@ -512,42 +505,42 @@ jobs:
- name: Vendor - EPEL
if: inputs.vendors == 'all' && env.target_distro == 'almalinux'
run: |
sudo vagrant ssh elevatevm -c "sudo /vagrant/Verndors.sh epel ${{ env.source_release }}" || exit 1
sudo vagrant ssh elevatevm -c "sudo /vagrant/Vendors.sh epel ${{ env.source_release }}" || exit 1
- name: Vendor - KernelCare
if: inputs.vendors == 'all'
run: |
sudo vagrant ssh elevatevm -c "sudo /vagrant/Verndors.sh kernelcare ${{ env.source_release }}" || exit 1
sudo vagrant ssh elevatevm -c "sudo /vagrant/Vendors.sh kernelcare ${{ env.source_release }}" || exit 1
- name: Vendor - Nginx
if: inputs.vendors == 'all'
run: |
sudo vagrant ssh elevatevm -c "sudo /vagrant/Verndors.sh nginx ${{ env.source_release }}" || exit 1
sudo vagrant ssh elevatevm -c "sudo /vagrant/Vendors.sh nginx ${{ env.source_release }}" || exit 1
- name: Vendor - MariaDB
if: inputs.vendors == 'all'
run: |
sudo vagrant ssh elevatevm -c "sudo /vagrant/Verndors.sh mariadb ${{ env.source_release }}" || exit 1
sudo vagrant ssh elevatevm -c "sudo /vagrant/Vendors.sh mariadb ${{ env.source_release }}" || exit 1
- name: Vendor - PostgreSQL
if: inputs.vendors == 'all'
run: |
sudo vagrant ssh elevatevm -c "sudo /vagrant/Verndors.sh postgresql ${{ env.source_release }}" || exit 1
sudo vagrant ssh elevatevm -c "sudo /vagrant/Vendors.sh postgresql ${{ env.source_release }}" || exit 1
- name: Vendor - Docker-CE
if: inputs.vendors == 'all'
run: |
sudo vagrant ssh elevatevm -c "sudo /vagrant/Verndors.sh docker ${{ env.source_release }}" || exit 1
sudo vagrant ssh elevatevm -c "sudo /vagrant/Vendors.sh docker ${{ env.source_release }}" || exit 1
- name: Vendor - Microsoft
if: inputs.vendors == 'all'
run: |
sudo vagrant ssh elevatevm -c "sudo /vagrant/Verndors.sh microsoft ${{ env.source_release }}" || exit 1
sudo vagrant ssh elevatevm -c "sudo /vagrant/Vendors.sh microsoft ${{ env.source_release }}" || exit 1
- name: Vendor - Imunify360
if: inputs.vendors == 'all' && matrix.scenario == '8'
run: |
sudo vagrant ssh elevatevm -c "sudo /vagrant/Verndors.sh imunify ${{ env.source_release }}" || exit 1
sudo vagrant ssh elevatevm -c "sudo /vagrant/Vendors.sh imunify ${{ env.source_release }}" || exit 1
- name: leapp preupgrade
id: leapp-preupgrade
Expand Down Expand Up @@ -639,4 +632,4 @@ jobs:
.addList([${{ env.pkgs_versions }}], true)
.addHeading('${{ env.source_distro }}${{ env.source_release }} packages remain installed:', '4')
.addList([${{ env.remain_pkgs }}], true)
.write()
.write()

0 comments on commit 5745bbd

Please sign in to comment.