Commit 7d7b3a2e authored by Holger Levsen's avatar Holger Levsen

reproducible Archlinux: fixup SQL

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent 2f701ff7
......@@ -339,6 +339,7 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
** create json
** debian uses a table removed_packages, should this be used here too?
** debian uses a table manual_scheduler to limit the amount of packages someone can schedule per day...
** should breakages job look for archlinux breakages?
* fix build.sh:
** build2.log doesnt get deleted if build1 fails
......
......@@ -44,7 +44,6 @@ update_pkg_in_db() {
local ARCHLINUX_PKG_PATH=$ARCHBASE/$REPOSITORY/$SRCPACKAGE
cd "$ARCHLINUX_PKG_PATH"
BUILD_DURATION="$(cat pkg.build_duration)"
BUILD_DATE="$(find . -name pkg.build_duration -printf '%TY-%Tm-%Td %TH:%TM\n')"
BUILD_STATE=$(cat pkg.state)
BUILD_VERSION="$(cat pkg.version)"
SUITE="archlinux_$REPOSITORY"
......@@ -54,11 +53,13 @@ update_pkg_in_db() {
exit 1
fi
QUERY="INSERT into results (package_id, version, status, build_date, build_duration, node1, node2, job)
VALUES ('${SRCPKGID}', '$BUILD_VERSION', '$BUILD_STATE', '$BUILD_DATE', '$BUILD_DURATION', 'pb3 or pb4', 'pb3 or pb4', 'unknown');"
VALUES ('${SRCPKGID}', '$BUILD_VERSION', '$BUILD_STATE', '$DATE', '$BUILD_DURATION', '$NODE1', '$NODE2', '$BUILD_URL')
ON CONFLICT (package_id)
DO UPDATE SET version='$BUILD_VERSION', status='$BUILD_STATE', build_date='$DATE_DATE', build_duration='$BUILD_DURATION', node1='$NODE1', node2='$NODE2', job='$BUILD_URL' WHERE results.package_id='$SRCPKGID'";
echo "$QUERY"
query_db "$QUERY"
QUERY="INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration, node1, node2, job)
VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB');"
VALUES ('$SRCPACKAGE', '$BUILD_VERSION', '$SUITE', '$ARCH', '$BUILD_STATE', '$DATE', '$BUILD_DURATION', '$NODE1', '$NODE2', '$BUILD_URL');"
echo "$QUERY"
query_db "$QUERY"
# unmark build since it's properly finished
......@@ -208,8 +209,7 @@ create_pkg_html() {
esac
fi
echo " </td>" >> $HTML_BUFFER
local BUILD_DATE="$(date -u --date=@$(stat -c %Y $ARCHLINUX_PKG_PATH/build1.log) +'%F %R %Z')"
echo " <td>$BUILD_DATE" >> $HTML_BUFFER
echo " <td>$DATE" >> $HTML_BUFFER
local DURATION=$(cat $ARCHLINUX_PKG_PATH/pkg.build_duration 2>/dev/null || true)
if [ -n "$DURATION" ]; then
local HOUR=$(echo "$DURATION/3600"|bc)
......
......@@ -23,7 +23,6 @@ MEMBERS_404="0 1 2 3 4 5 6 7 8 9 A"
MEMBERS_FTBR="0 1 2"
HTML_BUFFER=$(mktemp -t archlinuxrb-html-XXXXXXXX)
HTML_REPOSTATS=$(mktemp -t archlinuxrb-html-XXXXXXXX)
SIZE=""
ARCHLINUX_TOTAL=0
ARCHLINUX_TESTED=0
ARCHLINUX_NR_FTBFS=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment