copr-be: slight copr-ping submit script update
This commit is contained in:
parent
57d6d1446a
commit
162e11ae1e
1 changed files with 29 additions and 8 deletions
|
@ -1,11 +1,32 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
start_time=$(date +%s)
|
source_rpm_url=https://pagure.io/copr/copr-test-sources/raw/master/f/buildtag-0-0.src.rpm
|
||||||
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)
|
|
||||||
took=$(( stop_time - start_time ))
|
|
||||||
|
|
||||||
|
log()
|
||||||
|
{
|
||||||
|
stop_time=$(date +%s)
|
||||||
|
took=$(( stop_time - start_time ))
|
||||||
echo "build_id=$build_id start=$start_time stop=$stop_time took=$took exit_status=$exit_status" \
|
echo "build_id=$build_id start=$start_time stop=$stop_time took=$took exit_status=$exit_status" \
|
||||||
>> "{{ ping_log }}"
|
>> "{{ ping_log }}"
|
||||||
|
}
|
||||||
|
|
||||||
|
start_time=$(date +%s)
|
||||||
|
output=$(copr build --nowait @copr/copr-ping "$source_rpm_url")
|
||||||
|
build_id=$(echo "$output" | grep 'Created builds:' | cut -d' ' -f3)
|
||||||
|
exit_status=$?
|
||||||
|
if ! expr "$build_id" : '\([0-9]*\)$'; then
|
||||||
|
# we don't even have the build_id
|
||||||
|
build_id=unknown
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $exit_status -ne 0; then
|
||||||
|
log
|
||||||
|
fi
|
||||||
|
|
||||||
|
copr watch-build "$build_id"
|
||||||
|
exit_status=$?
|
||||||
|
log
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue