From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SOpPM-0007Cs-Ba for garchives@archives.gentoo.org; Mon, 30 Apr 2012 12:08:48 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 90A2DE0AD3; Mon, 30 Apr 2012 12:08:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 51448E0AE6 for ; Mon, 30 Apr 2012 12:08:34 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 83C661B401F for ; Mon, 30 Apr 2012 12:08:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 4ABE8E5403 for ; Mon, 30 Apr 2012 12:08:32 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1335787533.bbae8b8f038b93563a7bfc5dec8f2adc6db65edd.zorry@gentoo> Subject: [gentoo-commits] dev/zorry:master commit in: gobs/bin/, gobs/pym/ X-VCS-Repository: dev/zorry X-VCS-Files: gobs/bin/gobs_guest_jobs gobs/bin/gobs_host_jobs gobs/pym/sync.py X-VCS-Directories: gobs/bin/ gobs/pym/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: bbae8b8f038b93563a7bfc5dec8f2adc6db65edd X-VCS-Branch: master Date: Mon, 30 Apr 2012 12:08:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 3e67374f-d5f9-4644-abd6-0ce94ea0812f X-Archives-Hash: 8478ed121fe99cccbcbdefb838f720ef commit: bbae8b8f038b93563a7bfc5dec8f2adc6db65edd Author: Magnus Granberg gentoo org> AuthorDate: Mon Apr 30 12:05:33 2012 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Mon Apr 30 12:05:33 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/zorry.git;a=3D= commit;h=3Dbbae8b8f adding git pull and emerge sync --- gobs/bin/gobs_guest_jobs | 22 +++++++++++++++++++++- gobs/bin/gobs_host_jobs | 22 +++++++++++++++++++++- gobs/pym/sync.py | 5 +++-- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/gobs/bin/gobs_guest_jobs b/gobs/bin/gobs_guest_jobs index 2c497d6..43b8cc1 100755 --- a/gobs/bin/gobs_guest_jobs +++ b/gobs/bin/gobs_guest_jobs @@ -13,7 +13,7 @@ if CM.getName()=3D=3D'pgsql': from gobs.pgsql import * =20 from gobs.check_setup import check_configure_guest -from gobs.sync import git_pull +from gobs.sync import git_pull, sync_tree from gobs.build_queru import queruaction from gobs.buildquerydb import add_buildquery_main, del_buildquery_main =20 @@ -62,6 +62,26 @@ def main_loop(config_profile): else: update_job_list(conn, "Fail", job[1]) logging.info("Job %s did fail. Config: %s", job[0], config_profile) + elif job[0] =3D=3D "gitsync": + update_job_list(conn, "Runing", job[1]) + logging.info("Job %s is runing. Config: %s", job[0], config_profile) + result =3D git_pull() + if result is True: + update_job_list(conn, "Done", job[1]) + logging.info("Job %s is done. Config: %s", job[0], config_profile) + else: + update_job_list(conn, "Fail", job[1]) + logging.info("Job %s did fail. Config: %s", job[0], config_profile) + elif job[0] =3D=3D "emergesync": + update_job_list(conn, "Runing", job[1]) + logging.info("Job %s is runing. Config: %s", job[0], config_profile) + result =3D sync_tree() + if result is True: + update_job_list(conn, "Done", job[1]) + logging.info("Job %s is done. Config: %s", job[0], config_profile) + else: + update_job_list(conn, "Fail", job[1]) + logging.info("Job %s did fail. Config: %s", job[0], config_profile)= =09 repeat =3D False time.sleep(10) CM.putConnection(conn) diff --git a/gobs/bin/gobs_host_jobs b/gobs/bin/gobs_host_jobs index 812b942..ea39f3b 100755 --- a/gobs/bin/gobs_host_jobs +++ b/gobs/bin/gobs_host_jobs @@ -6,7 +6,7 @@ from __future__ import print_function =20 from gobs.readconf import get_conf_settings from gobs.updatedb import update_db_main -from gobs.buildquerydb import add_buildquery_main, del_buildquery_main +from gobs.sync import git_pull, sync_tree =20 reader =3D get_conf_settings() gobs_settings_dict=3Dreader.read_gobs_settings_all() @@ -49,6 +49,26 @@ def main(): else: update_job_list(conn, "Fail", job[1]) logging.info("Job %s did fail. Config: %s", job[0], config_profile) + elif job[0] =3D=3D "gitsync": + update_job_list(conn, "Runing", job[1]) + logging.info("Job %s is runing. Config: %s", job[0], config_profile) + result =3D git_pull() + if result is True: + update_job_list(conn, "Done", job[1]) + logging.info("Job %s is done. Config: %s", job[0], config_profile) + else: + update_job_list(conn, "Fail", job[1]) + logging.info("Job %s did fail. Config: %s", job[0], config_profile) + elif job[0] =3D=3D "emergesync": + update_job_list(conn, "Runing", job[1]) + logging.info("Job %s is runing. Config: %s", job[0], config_profile= ) + result =3D sync_tree() + if result is True: + update_job_list(conn, "Done", job[1]) + logging.info("Job %s is done. Config: %s", job[0], config_profile) + else: + update_job_list(conn, "Fail", job[1]) + logging.info("Job %s did fail. Config: %s", job[0], config_profile= ) =09 repeat =3D False CM.putConnection(conn) time.sleep(60) diff --git a/gobs/pym/sync.py b/gobs/pym/sync.py index a39ff4d..ee4bd66 100644 --- a/gobs/pym/sync.py +++ b/gobs/pym/sync.py @@ -18,12 +18,13 @@ if CM.getName()=3D=3D'pgsql': =20 def git_pull(): logging.info("Git pull") - repo =3D Repo("/var/lib/gobs/" + gobs_settings_dict['gobs_gitreponame']= + "/") + repo =3D Repo("/var/cache/gobs/" + gobs_settings_dict['gobs_gitreponame= '] + "/") repo_remote =3D repo.remotes.origin repo_remote.pull() master =3D repo.head.reference - print(master.log()) + logging.info("Git log: %s", master.log()) logging.info("Git pull ... Done.") + return True =20 def sync_tree(): conn=3DCM.getConnection()