Merge branch 'develop' into feature/groups

This commit is contained in:
Maksim Chegulov 2024-02-20 11:16:04 +03:00
commit 5e56dc1441
9 changed files with 70 additions and 32 deletions

View File

@ -68,7 +68,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python 3.
uses: actions/setup-python@v5
@ -81,9 +81,14 @@ jobs:
sudo apt update -y
sudo apt install vagrant virtualbox -y
- name: Free Disk Space
run: |
sudo rm -rf /usr/local/lib/android /opt/ghc
sudo docker image prune --all --force
- name: "Test production scripts with ${{matrix.name}}"
if: ${{ github.event_name == 'schedule' }}
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 2
timeout_minutes: 40
@ -107,7 +112,7 @@ jobs:
- name: "Test Local scripts with ${{matrix.name}}"
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 2
timeout_minutes: 40

View File

@ -66,7 +66,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python 3.
uses: actions/setup-python@v5
@ -86,7 +86,7 @@ jobs:
- name: Testing with update ${{matrix.name}}
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 1
timeout_minutes: 60

View File

@ -55,13 +55,17 @@ jobs:
run: |
cd .${DOCKER_PATH}
if [ "${{ matrix.branch }}" = "develop" ]; then
DOCKER_TAG="develop.${{ github.run_number }}"
else
DOCKER_TAG=$(echo "${{ matrix.branch }}" | sed '/^release\b\|^hotfix\b\|^feature\b/s/release.*\/\|hotfix.*\/\|feature.*\///; s/-git-action$//; s/^v//').${{github.run_number}}
PRODUCT_VERSION="develop"
DOCKER_TAG=${PRODUCT_VERSION}.${{ github.run_number }}
else
PRODUCT_VERSION=$(echo "${{ matrix.branch }}" | sed '/^release\b\|^hotfix\b\|^feature\b/s/release.*\/\|hotfix.*\/\|feature.*\///; s/-git-action$//; s/^v//')
DOCKER_TAG=${PRODUCT_VERSION}.${{github.run_number}}
fi
export DOCKER_TAG
docker buildx bake -f build.yml \
--set *.args.GIT_BRANCH=${{ matrix.branch }} \
--set *.args.PRODUCT_VERSION=${PRODUCT_VERSION} \
--set *.args.BUILD_NUMBER=${BUILD_NUMBER} \
--set *.platform=linux/amd64 \
--push

View File

@ -64,7 +64,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python 3.
uses: actions/setup-python@v5
@ -86,7 +86,7 @@ jobs:
sudo docker image prune --all --force
- name: Rebuild boxes
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 2
timeout_minutes: 90

View File

@ -371,7 +371,7 @@
"api": "api/2.0",
"alias": {
"min": 3,
"max": 100
"max": 63
},
"api-system": "",
"api-cache": "",

View File

@ -33,16 +33,20 @@ if rpm -qa | grep mariadb.*config >/dev/null 2>&1; then
fi
#Add repositories: EPEL, REMI and RPMFUSION
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-$REV.noarch.rpm || true
rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-$REV.rpm || true
yum localinstall -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$REV.noarch.rpm
[ "$DIST" != "fedora" ] && { rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-$REV.noarch.rpm || true; }
rpm -ivh https://rpms.remirepo.net/$REMI_DISTR_NAME/remi-release-$REV.rpm || true
yum localinstall -y --nogpgcheck https://download1.rpmfusion.org/free/$RPMFUSION_DISTR_NAME/rpmfusion-free-release-$REV.noarch.rpm
[ "$REV" = "9" ] && update-crypto-policies --set DEFAULT:SHA1
[ "$DIST" != "redhat" ] && { [ "$REV" = "9" ] && TESTING_REPO="--enablerepo=crb" || POWERTOOLS_REPO="--enablerepo=powertools"; } || /usr/bin/crb enable
if [ "$DIST" == "centos" ]; then
[ "$REV" = "9" ] && TESTING_REPO="--enablerepo=crb" || POWERTOOLS_REPO="--enablerepo=powertools"
elif [ "$DIST" == "redhat" ]; then
/usr/bin/crb enable
fi
#add rabbitmq & erlang repo
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | os=centos dist=$REV bash
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | os=centos dist=$REV bash
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | bash
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | bash
#add nodejs repo
NODE_VERSION="18"
@ -50,8 +54,8 @@ curl -fsSL https://rpm.nodesource.com/setup_${NODE_VERSION}.x | sed '/update -y/
#add mysql repo
dnf remove -y @mysql && dnf module -y reset mysql && dnf module -y disable mysql
MYSQL_REPO_VERSION="$(curl https://repo.mysql.com | grep -oP "mysql80-community-release-el${REV}-\K.*" | grep -o '^[^.]*' | sort -n | tail -n1)"
yum localinstall -y https://repo.mysql.com/mysql80-community-release-el${REV}-${MYSQL_REPO_VERSION}.noarch.rpm || true
MYSQL_REPO_VERSION="$(curl https://repo.mysql.com | grep -oP "mysql80-community-release-${MYSQL_DISTR_NAME}${REV}-\K.*" | grep -o '^[^.]*' | sort | tail -n1)"
yum localinstall -y https://repo.mysql.com/mysql80-community-release-${MYSQL_DISTR_NAME}${REV}-${MYSQL_REPO_VERSION}.noarch.rpm || true
if ! rpm -q mysql-community-server; then
MYSQL_FIRST_TIME_INSTALL="true";
@ -72,7 +76,8 @@ autorefresh=1
type=rpm-md
END
# add nginx repo
# add nginx repo, Fedora doesn't need it
if [ "$DIST" != "fedora" ]; then
cat > /etc/yum.repos.d/nginx.repo <<END
[nginx-stable]
name=nginx stable repo
@ -82,17 +87,19 @@ enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
END
fi
rpm --import https://openresty.org/package/pubkey.gpg
OPENRESTY_REPO_FILE=$( [[ "$REV" -ge 9 ]] && echo "openresty2.repo" || echo "openresty.repo" )
curl -o /etc/yum.repos.d/openresty.repo "https://openresty.org/package/centos/${OPENRESTY_REPO_FILE}"
OPENRESTY_REPO_FILE=$( [[ "$REV" -ge 9 && "$DIST" != "fedora" ]] && echo "openresty2.repo" || echo "openresty.repo" )
curl -o /etc/yum.repos.d/openresty.repo "https://openresty.org/package/${OPENRESTY_DISTR_NAME}/${OPENRESTY_REPO_FILE}"
[ "$DIST" == "fedora" ] && sed -i "s/\$releasever/$OPENRESTY_REV/g" /etc/yum.repos.d/openresty.repo
${package_manager} -y install epel-release \
${package_manager} -y install $([ $DIST != "fedora" ] && echo "epel-release") \
python3 \
nodejs ${NODEJS_OPTION} \
dotnet-sdk-8.0 \
elasticsearch-${ELASTIC_VERSION} --enablerepo=elasticsearch \
mysql-server \
mysql-community-server \
postgresql \
postgresql-server \
rabbitmq-server$rabbitmq_version \

View File

@ -66,15 +66,30 @@ read_unsupported_installation () {
esac
}
DIST=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release)
DIST=$(echo "${DIST}" | sed -n '/-.*/s///p')
DIST_LOWER=$(echo "${DIST}" | tr '[:upper:]' '[:lower:]')
DIST=$(rpm -q --queryformat '%{NAME}' centos-release redhat-release fedora-release | awk -F'[- ]|package' '{print tolower($1)}' | tr -cd '[:alpha:]')
[ -z $DIST ] && DIST=$(cat /etc/redhat-release | awk -F 'Linux|release| ' '{print tolower($1)}')
REV=$(sed -n 's/.*release\ \([0-9]*\).*/\1/p' /etc/redhat-release)
REV=${REV:-"7"}
# Check if it's Centos less than 8
if [ "${REV}" -lt 8 ]; then
REMI_DISTR_NAME="enterprise"
RPMFUSION_DISTR_NAME="el"
MYSQL_DISTR_NAME="el"
OPENRESTY_DISTR_NAME="centos"
SUPPORTED_FEDORA_FLAG="true"
if [ "$DIST" == "fedora" ]; then
REMI_DISTR_NAME="fedora"
OPENRESTY_DISTR_NAME="fedora"
RPMFUSION_DISTR_NAME="fedora"
MYSQL_DISTR_NAME="fc"
OPENRESTY_REV=$([ "$REV" -ge 37 ] && echo 36 || echo "$REV")
FEDORA_SUPP=$(curl https://docs.fedoraproject.org/en-US/releases/ | awk '/Supported Releases/,/EOL Releases/' | grep -oP 'F\d+' | tr -d 'F')
[ ! "$(echo "$FEDORA_SUPP" | grep "$REV")" ] && SUPPORTED_FEDORA_FLAG="false"
fi
# Check if it's Centos less than 8 or Fedora release is out of service
if [ "${REV}" -lt 8 ] || [ "$SUPPORTED_FEDORA_FLAG" == "false" ]; then
echo "Your ${DIST} ${REV} operating system has reached the end of its service life."
echo "Please consider upgrading your operating system or using a Docker installation."
exit 1

View File

@ -492,6 +492,13 @@ setup_openresty(){
fi
if [ "$DIST" = "RedHat" ]; then
# Remove default nginx settings [error] port 80 is already in use
if [ -f /etc/nginx/nginx.conf ];
if grep -q "server {" /etc/nginx/nginx.conf ; then
sed -e '$a}' -e '/server {/,$d' -i /etc/nginx/nginx.conf
fi
fi
shopt -s nocasematch
PORTS=()
if command -v getenforce &> /dev/null; then

View File

@ -4,8 +4,8 @@ proxy_set_header Host $the_host;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
more_clear_headers 'Server';
more_clear_headers 'X-Powered-By';
proxy_hide_header 'Server';
proxy_hide_header 'X-Powered-By';
## HTTP host
server {