From nobody Mon Feb 9 10:27:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534931091377268.77854448686685; Wed, 22 Aug 2018 02:44:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B6302C0587F5; Wed, 22 Aug 2018 09:44:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81BCF106424C; Wed, 22 Aug 2018 09:44:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 30880181A439; Wed, 22 Aug 2018 09:44:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7M9idQc003345 for ; Wed, 22 Aug 2018 05:44:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 976382166BA8; Wed, 22 Aug 2018 09:44:39 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 35CC42166BA1 for ; Wed, 22 Aug 2018 09:44:39 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 22 Aug 2018 11:44:25 +0200 Message-Id: <20180822094427.2709-11-abologna@redhat.com> In-Reply-To: <20180822094427.2709-1-abologna@redhat.com> References: <20180822094427.2709-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH v3 10/12] lcitool: Support building arbitrary branches X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 22 Aug 2018 09:44:50 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Building master is useful for CI purposes and to debug CI failures locally, but when developing we want to be able to build a personal branch to validate in-progress changes. Signed-off-by: Andrea Bolognani --- guests/lcitool | 30 ++++++++++++++++-------- guests/playbooks/build/jobs/defaults.yml | 1 - 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/guests/lcitool b/guests/lcitool index 2901a92..ec81448 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -351,8 +351,13 @@ class Application: metavar=3D"PROJECTS", help=3D"list of projects to consider", ) + self._parser.add_argument( + "-b", + metavar=3D"BRANCH", + help=3D"git branch to use when performing builds", + ) =20 - def _execute_playbook(self, playbook, hosts, projects): + def _execute_playbook(self, playbook, hosts, projects, branch): base =3D Util.get_base() =20 flavor =3D self._config.get_flavor() @@ -372,6 +377,7 @@ class Application: "root_password_file": root_pass_file, "flavor": flavor, "selected_projects": selected_projects, + "branch": branch, }) =20 cmd =3D [ @@ -396,15 +402,15 @@ class Application: except Exception: raise Error("Failed to run {} on '{}'".format(playbook, hosts)) =20 - def _action_hosts(self, _hosts, _projects): + def _action_hosts(self, _hosts, _projects, _branch): for host in self._inventory.expand_pattern("all"): print(host) =20 - def _action_projects(self, _hosts, _projects): + def _action_projects(self, _hosts, _projects, _branch): for project in self._projects.expand_pattern("all"): print(project) =20 - def _action_install(self, hosts, _projects): + def _action_install(self, hosts, _projects, _branch): base =3D Util.get_base() =20 flavor =3D self._config.get_flavor() @@ -475,13 +481,16 @@ class Application: except Exception: raise Error("Failed to install '{}'".format(host)) =20 - def _action_update(self, hosts, projects): - self._execute_playbook("update", hosts, projects) + def _action_update(self, hosts, projects, _branch): + self._execute_playbook("update", hosts, projects, None) + + def _action_build(self, hosts, projects, branch): + if branch is None: + raise Error("Missing branch") =20 - def _action_build(self, hosts, projects): - self._execute_playbook("build", hosts, projects) + self._execute_playbook("build", hosts, projects, branch) =20 - def _action_dockerfile(self, hosts, projects): + def _action_dockerfile(self, hosts, projects, _branch): mappings =3D self._projects.get_mappings() =20 hosts =3D self._inventory.expand_pattern(hosts) @@ -553,11 +562,12 @@ class Application: action =3D cmdline.a hosts =3D cmdline.h projects =3D cmdline.p + branch =3D cmdline.b =20 method =3D "_action_{}".format(action.replace("-", "_")) =20 if hasattr(self, method): - getattr(self, method).__call__(hosts, projects) + getattr(self, method).__call__(hosts, projects, branch) else: raise Error("Invalid action '{}'".format(action)) =20 diff --git a/guests/playbooks/build/jobs/defaults.yml b/guests/playbooks/bu= ild/jobs/defaults.yml index ce49f5a..b4e9343 100644 --- a/guests/playbooks/build/jobs/defaults.yml +++ b/guests/playbooks/build/jobs/defaults.yml @@ -1,5 +1,4 @@ --- -branch: master variant: '' all_machines: - libvirt-centos-7 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list