#logger.debug("INSERT INTO jenkins_build(jenkins_build_number, jenkins_job_id) VALUES(%s, %s) RETURNING id" % (number, db_id))
return cur.fetchone()[0]
-def db_add_build_result(con, number, start, end):
+def db_add_build_result(con, build_id, start, end):
cur = con.cursor()
cur.execute("SAVEPOINT a")
try:
- cur.execute("INSERT INTO jenkins_build_result(jenkins_build_number, build_start, build_end, successful) VALUES(%s, '%s', '%s', %s) RETURNING id" % (number, start, end, 'true'))
+ cur.execute("INSERT INTO jenkins_build_result(jenkins_build_id, build_start, build_end, successful) VALUES(%s, '%s', '%s', %s) RETURNING id" % (build_id, start, end, 'true'))
except psycopg2.DatabaseError as e:
cur.execute("ROLLBACK TO a") # have to rollback after failed command
- #logger.debug("INSERT INTO jenkins_build_result(jenkins_build_number, build_start, build_end, successful) VALUES(%s, '%s', '%s', %s) RETURNING id" % (number, start, end, 'true'))
+ #logger.debug("INSERT INTO jenkins_build_result(jenkins_build_id, build_start, build_end, successful) VALUES(%s, '%s', '%s', %s) RETURNING id" % (build_id, start, end, 'true'))
return cur.fetchone()[0]
def db_add_package(con, package):
#logger.debug("INSERT success job %s" % job_name)
# maybe FIXME: we could add the build already once its started, but for package builds we dont wanna add failures to the db at all
db_build_id = db_add_build (con, build_number, db_job_id)
- db_build_result_id = db_add_build_result (con, build_number, start, end)
+ db_build_result_id = db_add_build_result (con, db_build_id, start, end)
#logger.debug("INSERT success build number %s" % build_number)
#logger.debug("processing %s" %(changes_file))
cmd = ["dcmd", '--deb', changes_file]