Skip to content

Commit

Permalink
Test time build rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
isboston committed Jan 29, 2025
1 parent aabb1a7 commit 3f8daba
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 38 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/build_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ env:
PRODUCT_LOW: "docspace"
BUILD_NUMBER: ${{ github.run_number }}
PACKAGE_DIRECTORY: "/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}"
BRANCH_BUILDTOOLS: 'develop'
BRANCH_BUILDTOOLS: 'feature/test-build-packages'
BRANCH_CLIENT: 'develop'
BRANCH_SERVER: 'hotfix/v3.0.2'

Expand Down Expand Up @@ -156,60 +156,60 @@ jobs:
run: |
cd install/rpm/SPECS
START_DOWNLOAD=$(date +%s)
# START_DOWNLOAD=$(date +%s)
wget -q -O ./SOURCES/buildtools.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-buildtools/archive/${BRANCH_BUILDTOOLS}.tar.gz"
wget -q -O ./SOURCES/client.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-client/archive/${BRANCH_CLIENT}.tar.gz"
wget -q -O ./SOURCES/server.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-server/archive/${BRANCH_SERVER}.tar.gz"
wget -q -O ./SOURCES/DocStore.tar.gz "https://github.com/ONLYOFFICE/document-templates/archive/main/community-server.tar.gz"
wget -q -O ./SOURCES/campaigns.tar.gz "https://github.com/ONLYOFFICE/ASC.Web.Campaigns/archive/master.tar.gz"
wget -q -O ./SOURCES/plugins.tar.gz "https://github.com/ONLYOFFICE/$PRODUCT-plugins/archive/master.tar.gz"
END_DOWNLOAD=$(date +%s)
echo "Download time: $((END_DOWNLOAD - START_DOWNLOAD)) seconds"
# END_DOWNLOAD=$(date +%s)
# echo "Download time: $((END_DOWNLOAD - START_DOWNLOAD)) seconds"
mv ./SOURCES/product.rpmlintrc ./SOURCES/${PRODUCT_LOW}.rpmlintrc
sed -i -e '/BuildRequires/d' product.spec
mkdir -p BUILD
for archive in ./SOURCES/*.tar.gz; do
tar -xzf "$archive" -C BUILD
extracted_folder=$(tar -tzf "$archive" | head -1 | cut -f1 -d"/")
new_folder=$(echo "$extracted_folder" | sed -E 's/^.*?(client|plugins|buildtools|server|templates)//')
if [[ "$extracted_folder" != "$new_folder" ]]; then
mv "BUILD/$extracted_folder" "BUILD/$new_folder"
fi
done
# mkdir -p BUILD
# for archive in ./SOURCES/*.tar.gz; do
# tar -xzf "$archive" -C BUILD
# extracted_folder=$(tar -tzf "$archive" | head -1 | cut -f1 -d"/")
# new_folder=$(echo "$extracted_folder" | sed -E 's/^.*?(client|plugins|buildtools|server|templates)//')
# if [[ "$extracted_folder" != "$new_folder" ]]; then
# mv "BUILD/$extracted_folder" "BUILD/$new_folder"
# fi
# done
START_FRONTEND=$(date +%s)
bash ../../common/build-frontend.sh --srcpath install/rpm/SPECS/BUILD -di "false"
END_FRONTEND=$(date +%s)
echo "Frontend build time: $((END_FRONTEND - START_FRONTEND)) seconds"
# START_FRONTEND=$(date +%s)
# bash ../../common/build-frontend.sh --srcpath install/rpm/SPECS/BUILD -di "false"
# END_FRONTEND=$(date +%s)
# echo "Frontend build time: $((END_FRONTEND - START_FRONTEND)) seconds"
START_BACKEND=$(date +%s)
bash ../../common/build-backend.sh --srcpath install/rpm/SPECS/BUILD
END_BACKEND=$(date +%s)
echo "Backend build time: $((END_BACKEND - START_BACKEND)) seconds"
# START_BACKEND=$(date +%s)
# bash ../../common/build-backend.sh --srcpath install/rpm/SPECS/BUILD
# END_BACKEND=$(date +%s)
# echo "Backend build time: $((END_BACKEND - START_BACKEND)) seconds"
START_PUBLISH=$(date +%s)
bash ../../common/publish-backend.sh --srcpath install/rpm/SPECS/BUILD/server
END_PUBLISH=$(date +%s)
echo "Backend publish time: $((END_PUBLISH - START_PUBLISH)) seconds"
# START_PUBLISH=$(date +%s)
# bash ../../common/publish-backend.sh --srcpath install/rpm/SPECS/BUILD/server
# END_PUBLISH=$(date +%s)
# echo "Backend publish time: $((END_PUBLISH - START_PUBLISH)) seconds"
sed -i \
-e '/bash install\/common\/build-frontend\.sh --srcpath %{_builddir} -di "false"/d' \
-e '/bash install\/common\/build-backend\.sh --srcpath %{_builddir}/d' \
-e '/bash install\/common\/publish-backend\.sh --srcpath %{_builddir}\/server/d' \
product.spec
# sed -i \
# -e '/bash install\/common\/build-frontend\.sh --srcpath %{_builddir} -di "false"/d' \
# -e '/bash install\/common\/build-backend\.sh --srcpath %{_builddir}/d' \
# -e '/bash install\/common\/publish-backend\.sh --srcpath %{_builddir}\/server/d' \
# product.spec
START_RPMBUILD=$(date +%s)
# START_RPMBUILD=$(date +%s)
rpmbuild -D "packager Ascensio System SIA <[email protected]>" \
-D "_topdir $(pwd)" \
-D "version ${PRODUCT_VERSION}" \
-D "release ${BUILD_NUMBER}" -ba product.spec
END_RPMBUILD=$(date +%s)
echo "RPM build time: $((END_RPMBUILD - START_RPMBUILD)) seconds"
# END_RPMBUILD=$(date +%s)
# echo "RPM build time: $((END_RPMBUILD - START_RPMBUILD)) seconds"
TOTAL_TIME=$((END_RPMBUILD - START_DOWNLOAD))
echo "Total time: $TOTAL_TIME seconds"
# TOTAL_TIME=$((END_RPMBUILD - START_DOWNLOAD))
# echo "Total time: $TOTAL_TIME seconds"
- name: Sign DEB Packages
if: matrix.packageType == 'deb'
Expand Down
13 changes: 10 additions & 3 deletions install/rpm/SPECS/build.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

cd %{_builddir}/buildtools

time_execution() {
local start=$SECONDS
"$@"
local duration=$(( SECONDS - start ))
echo "Execution time: $duration seconds"
}

bash install/common/systemd/build.sh -pm "rpm"

bash install/common/build-frontend.sh --srcpath %{_builddir} -di "false"
bash install/common/build-backend.sh --srcpath %{_builddir}
bash install/common/publish-backend.sh --srcpath %{_builddir}/server
bash install/common/plugins-build.sh %{_builddir}/plugins
time_execution bash install/common/build-backend.sh --srcpath %{_builddir}
time_execution bash install/common/publish-backend.sh --srcpath %{_builddir}/server
time_execution bash install/common/plugins-build.sh %{_builddir}/plugins

rename -f -v "s/product([^\/]*)$/%{product}\$1/g" install/common/*

Expand Down

0 comments on commit 3f8daba

Please sign in to comment.