Merge branch 'hotfix/v2.5.1' into develop

This commit is contained in:
Alexey Safronov 2024-05-21 15:50:48 +04:00
commit a6b2bb16a0
5 changed files with 90 additions and 66 deletions

View File

@ -4,6 +4,7 @@ on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- '.github/workflows/ci-oci-install.yml'
- 'install/OneClickInstall/**'
- '!install/OneClickInstall/install-Docker.sh'
- '!install/OneClickInstall/docspace-install.sh'
@ -37,6 +38,14 @@ on:
type: boolean
description: 'Ubuntu 22.04'
default: true
ubuntu2404:
type: boolean
description: 'Ubuntu 24.04'
default: true
fedora39:
type: boolean
description: 'Fedora 39'
default: true
jobs:
prepare:
@ -55,7 +64,9 @@ jobs:
{"execute": '${{ github.event.inputs.debian11 || true }}', "name": "Debian11", "os": "debian11", "distr": "generic"},
{"execute": '${{ github.event.inputs.debian12 || true }}', "name": "Debian12", "os": "debian12", "distr": "generic"},
{"execute": '${{ github.event.inputs.ubuntu2004 || true }}', "name": "Ubuntu20.04", "os": "ubuntu2004", "distr": "generic"},
{"execute": '${{ github.event.inputs.ubuntu2204 || true }}', "name": "Ubuntu22.04", "os": "ubuntu2204", "distr": "generic"}
{"execute": '${{ github.event.inputs.ubuntu2204 || true }}', "name": "Ubuntu22.04", "os": "ubuntu2204", "distr": "generic"},
{"execute": '${{ github.event.inputs.ubuntu2204 || true }}', "name": "Ubuntu24.04", "os": "ubuntu-24.04", "distr": "bento"},
{"execute": '${{ github.event.inputs.fedora39 || true }}', "name": "Fedora39", "os": "39-cloud-base", "distr": "fedora"}
]
}' | jq -c '{include: [.include[] | select(.execute == true)]}')
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
@ -104,7 +115,7 @@ jobs:
DOWNLOAD_SCRIPT='-ds true' \
RAM='5100' \
CPU='3' \
ARGUMENTS="-arg '--skiphardwarecheck true --makeswap false'" \
ARGUMENTS="-arg '--skiphardwarecheck true'" \
vagrant up
on_retry_command: |
echo "RUN CLEAN UP: Destroy vagrant and one more try"
@ -129,7 +140,7 @@ jobs:
CPU='3' \
DOWNLOAD_SCRIPT='-ds false' \
TEST_REPO='-tr true' \
ARGUMENTS="-arg '--skiphardwarecheck true --makeswap false --localscripts true'" \
ARGUMENTS="-arg '--skiphardwarecheck true --localscripts true'" \
vagrant up
on_retry_command: |
echo "RUN CLEAN UP: Destroy vagrant and one more try"

View File

@ -48,9 +48,11 @@ NODE_VERSION="18"
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash -
#add dotnet repo
curl https://packages.microsoft.com/config/$DIST/$REV/packages-microsoft-prod.deb -O
echo -e "Package: *\nPin: origin \"packages.microsoft.com\"\nPin-Priority: 1002" | tee /etc/apt/preferences.d/99microsoft-prod.pref
dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb
if [[ "$DISTRIB_CODENAME" != noble ]]; then
curl https://packages.microsoft.com/config/$DIST/$REV/packages-microsoft-prod.deb -O
echo -e "Package: *\nPin: origin \"packages.microsoft.com\"\nPin-Priority: 1002" | tee /etc/apt/preferences.d/99microsoft-prod.pref
dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb
fi
MYSQL_REPO_VERSION="$(curl https://repo.mysql.com | grep -oP 'mysql-apt-config_\K.*' | grep -o '^[^_]*' | sort --version-sort --field-separator=. | tail -n1)"
MYSQL_PACKAGE_NAME="mysql-apt-config_${MYSQL_REPO_VERSION}_all.deb"

View File

@ -5,7 +5,7 @@ set -e
make_swap () {
DISK_REQUIREMENTS=6144; #6Gb free space
MEMORY_REQUIREMENTS=12000; #RAM ~12Gb
SWAPFILE="/${PRODUCT}_swapfile";
SWAPFILE="/${product}_swapfile";
AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');
TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);

View File

@ -5,17 +5,22 @@ set -e
function make_swap () {
local DISK_REQUIREMENTS=6144; #6Gb free space
local MEMORY_REQUIREMENTS=12000; #RAM ~12Gb
SWAPFILE="/${PRODUCT}_swapfile";
SWAPFILE="/${product}_swapfile";
local AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');
local TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);
local EXIST=$(swapon -s | awk '{ print $1 }' | { grep -x ${SWAPFILE} || true; });
if [[ -z $EXIST ]] && [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ] && [ ${AVAILABLE_DISK_SPACE} -gt ${DISK_REQUIREMENTS} ]; then
dd if=/dev/zero of=${SWAPFILE} count=6144 bs=1MiB
chmod 600 ${SWAPFILE}
mkswap ${SWAPFILE}
swapon ${SWAPFILE}
touch "$SWAPFILE"
# No Copy-on-Write - no compression
[[ "$DIST" == "fedora" ]] && chattr +C "$SWAPFILE"
# Allocate 6 GB, much faster than: dd if=/dev/zero of=${SWAPFILE} count=6144 bs=1MiB
fallocate -l 6G "$SWAPFILE"
chmod 600 "$SWAPFILE"
mkswap "$SWAPFILE"
# Activate, enable upon system boot
swapon "$SWAPFILE"
echo "$SWAPFILE none swap sw 0 0" >> /etc/fstab
fi
}

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
set -ex
while [ "$1" != "" ]; do
case $1 in
@ -105,6 +105,32 @@ function check_hw() {
}
#############################################################################################
# Add nexus repositories for test packages for .deb and .rpm packages
# Globals: None
# Arguments: None
# Outputs: None
#############################################################################################
function add-repo-deb() {
mkdir -p -m 700 $HOME/.gnupg
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://nexus.onlyoffice.com/repository/4testing-debian stable main" | \
sudo tee /etc/apt/sources.list.d/onlyoffice4testing.list
curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | \
gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/onlyoffice.gpg --import
chmod 644 /usr/share/keyrings/onlyoffice.gpg
}
function add-repo-rpm() {
cat > /etc/yum.repos.d/onlyoffice4testing.repo <<END
[onlyoffice4testing]
name=onlyoffice4testing repo
baseurl=https://nexus.onlyoffice.com/repository/centos-testing/4testing/main/noarch
gpgcheck=1
enabled=1
gpgkey=https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE
END
}
#############################################################################################
# Prepare vagrant boxes like: set hostname/remove postfix for DEB distributions
# Globals:
@ -115,70 +141,50 @@ function check_hw() {
# ☑ PREPAVE_VM: **<prepare_message>**
#############################################################################################
function prepare_vm() {
if [ -f /etc/os-release ]; then
source /etc/os-release
case $ID in
ubuntu)
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-deb
;;
if [ -f /etc/lsb-release ] ; then
DIST=`cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }'`
REV=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }'`
DISTRIB_CODENAME=`cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }'`
DISTRIB_RELEASE=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }'`
elif [ -f /etc/lsb_release ] || [ -f /usr/bin/lsb_release ] ; then
DIST=`lsb_release -a 2>&1 | grep 'Distributor ID:' | awk -F ":" '{print $2 }'`
REV=`lsb_release -a 2>&1 | grep 'Release:' | awk -F ":" '{print $2 }'`
DISTRIB_CODENAME=`lsb_release -a 2>&1 | grep 'Codename:' | awk -F ":" '{print $2 }'`
DISTRIB_RELEASE=`lsb_release -a 2>&1 | grep 'Release:' | awk -F ":" '{print $2 }'`
elif [ -f /etc/os-release ] ; then
DISTRIB_CODENAME=$(grep "VERSION=" /etc/os-release |awk -F= {' print $2'}|sed s/\"//g |sed s/[0-9]//g | sed s/\)$//g |sed s/\(//g | tr -d '[:space:]')
DISTRIB_RELEASE=$(grep "VERSION_ID=" /etc/os-release |awk -F= {' print $2'}|sed s/\"//g |sed s/[0-9]//g | sed s/\)$//g |sed s/\(//g | tr -d '[:space:]')
fi
debian)
if [ "$VERSION_CODENAME" == "bookworm" ]; then
apt-get update -y
apt install -y curl gnupg
fi
apt-get remove postfix -y
echo "${COLOR_GREEN}☑ PREPAVE_VM: Postfix was removed${COLOR_RESET}"
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-deb
;;
DIST=`echo "$DIST" | tr '[:upper:]' '[:lower:]' | xargs`;
DISTRIB_CODENAME=`echo "$DISTRIB_CODENAME" | tr '[:upper:]' '[:lower:]' | xargs`;
REV=`echo "$REV" | xargs`;
fedora)
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-rpm
;;
if [ ! -f /etc/centos-release ]; then
if [ "${DIST}" = "debian" ]; then
if [ "${DISTRIB_CODENAME}" == "bookworm" ]; then
apt-get update -y
apt install -y curl gnupg
fi
apt-get remove postfix -y
echo "${COLOR_GREEN}☑ PREPAVE_VM: Postfix was removed${COLOR_RESET}"
fi
if [ "${TEST_REPO_ENABLE}" == 'true' ]; then
mkdir -p -m 700 $HOME/.gnupg
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://nexus.onlyoffice.com/repository/4testing-debian stable main" | sudo tee /etc/apt/sources.list.d/onlyoffice4testing.list
curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/onlyoffice.gpg --import
chmod 644 /usr/share/keyrings/onlyoffice.gpg
fi
fi
if [ -f /etc/centos-release ]; then
if [ "${TEST_REPO_ENABLE}" == 'true' ]; then
cat > /etc/yum.repos.d/onlyoffice4testing.repo <<END
[onlyoffice4testing]
name=onlyoffice4testing repo
baseurl=https://nexus.onlyoffice.com/repository/centos-testing/4testing/main/noarch
gpgcheck=1
enabled=1
gpgkey=https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE
END
centos)
if [ "$VERSION_ID" == "9" ]; then
update-crypto-policies --set LEGACY
echo "${COLOR_GREEN}☑ PREPAVE_VM: sha1 gpg key chek enabled${COLOR_RESET}"
fi
[[ "${TEST_REPO_ENABLE}" == 'true' ]] && add-repo-rpm
yum -y install centos*-release
fi
;;
local REV=$(cat /etc/redhat-release | sed 's/[^0-9.]*//g')
if [[ "${REV}" =~ ^9 ]]; then
update-crypto-policies --set LEGACY
echo "${COLOR_GREEN}☑ PREPAVE_VM: sha1 gpg key chek enabled${COLOR_RESET}"
fi
*)
echo "${COLOR_RED}Failed to determine Linux dist${COLOR_RESET}"; exit 1
;;
esac
else
echo "${COLOR_RED}File /etc/os-release doesn't exist${COLOR_RESET}"; exit 1
fi
# Clean up home folder
rm -rf /home/vagrant/*
if [ -d /tmp/docspace ]; then
mv /tmp/docspace/* /home/vagrant
mv /tmp/docspace/* /home/vagrant
fi
echo '127.0.0.1 host4test' | sudo tee -a /etc/hosts