From 57d6d1446a738fcb4056a16749a630adeb7f3030 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 25 Oct 2021 11:37:24 +0200 Subject: [PATCH] copr-be: use pre-generated source RPM to speedup the check The source RPM "custom" generator (checkout from the online git source) was too slow sometimes (due to network connectivity). It too much affected the copr-ping check, giving us too many false positive reports. When the source RPM is pre-generated the overall build should finish roughly 2x faster. --- roles/copr/backend/files/copr-custom-script | 52 ------------------- .../copr/backend/files/setup-copr-project.sh | 27 ---------- .../backend/templates/copr-ping-script.sh.j2 | 2 +- 3 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 roles/copr/backend/files/copr-custom-script delete mode 100755 roles/copr/backend/files/setup-copr-project.sh diff --git a/roles/copr/backend/files/copr-custom-script b/roles/copr/backend/files/copr-custom-script deleted file mode 100644 index c667914b5e..0000000000 --- a/roles/copr/backend/files/copr-custom-script +++ /dev/null @@ -1,52 +0,0 @@ -#! /bin/sh - -cat <copr-ping.spec -%global _source_filedigest_algorithm md5 - -Name: copr-ping -Version: $(date +"%Y%m%d_%H%M%S") -Release: 1%{?dist} -Summary: A dummy package - -Group: NONE -License: GPLv3+ -URL: http://example.com/ - -%if 0%{?rhel} && 0%{?rhel} <= 5 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%endif -Source0: https://raw.githubusercontent.com/praiskup/quick-package/master/README.xz - -%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} - -%description -Description for the %name package that is used for various testing tasks. - - -%prep - - -%build - - -%install -rm -rf \$RPM_BUILD_ROOT -mkdir -p \$RPM_BUILD_ROOT/%{_pkgdocdir} -xz -d %{SOURCE0} --stdout > \$RPM_BUILD_ROOT/%{_pkgdocdir}/README - - -%clean -rm -rf \$RPM_BUILD_ROOT - - -%files -%dir %{_pkgdocdir} -%doc %{_pkgdocdir}/README - -%changelog -* Thu Jun 05 2014 Pavel Raiskup - 0-1 -- does nothing! -EOF - -echo "DOES NOTHING" > README -xz README diff --git a/roles/copr/backend/files/setup-copr-project.sh b/roles/copr/backend/files/setup-copr-project.sh deleted file mode 100755 index cc39ffb010..0000000000 --- a/roles/copr/backend/files/setup-copr-project.sh +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/bash - -# Execute this (on your box) to setup the package on the Copr side - -script=$(readlink -f "$(dirname "$0")")/copr-custom-script - -project=@copr/copr-ping -pkgname=copr-ping - -build_deps=() -copr_args=( - edit-package-custom "$project" \ - --webhook-rebuild on \ - --script "$script" \ - --script-chroot "fedora-latest-x86_64" \ - --script-builddeps "${build_deps[*]}" - --max-builds 10 -) - -for instance in copr dev-copr; do - config=~/.config/"$instance" - test -f "$config" || { - echo "can not setup $instance" - continue - } - copr --config "$config" "${copr_args[@]}" --name "$pkgname" -done diff --git a/roles/copr/backend/templates/copr-ping-script.sh.j2 b/roles/copr/backend/templates/copr-ping-script.sh.j2 index 11a8b434ee..d567c0ecec 100644 --- a/roles/copr/backend/templates/copr-ping-script.sh.j2 +++ b/roles/copr/backend/templates/copr-ping-script.sh.j2 @@ -1,7 +1,7 @@ #! /bin/sh start_time=$(date +%s) -output=$(copr build-package @copr/copr-ping --name copr-ping) +output=$(copr build @copr/copr-ping https://pagure.io/copr/copr-test-sources/raw/master/f/buildtag-0-0.src.rpm) exit_status=$? stop_time=$(date +%s) build_id=$(echo "$output" | grep 'Created builds:' | cut -d' ' -f3)