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.
This commit is contained in:
Pavel Raiskup 2021-10-25 11:37:24 +02:00
parent 12899ff66a
commit 57d6d1446a
3 changed files with 1 additions and 80 deletions

View file

@ -1,52 +0,0 @@
#! /bin/sh
cat <<EOF >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 <praiskup@redhat.com> - 0-1
- does nothing!
EOF
echo "DOES NOTHING" > README
xz README

View file

@ -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

View file

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
start_time=$(date +%s) 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=$? exit_status=$?
stop_time=$(date +%s) stop_time=$(date +%s)
build_id=$(echo "$output" | grep 'Created builds:' | cut -d' ' -f3) build_id=$(echo "$output" | grep 'Created builds:' | cut -d' ' -f3)