[yocto] [Yocto Autobuilder][PATCH 2/2] Autobuilder: add GitPoller ChangeSource for SingleBranchScheduler

californialsullivan at gmail.com californialsullivan at gmail.com
Thu Dec 11 10:02:15 PST 2014


From: California Sullivan <california.l.sullivan at intel.com>

Previously, PBChangeSource was the only option for changesources.
PBChangeSource was not always suitable since the remote repository had
to be able to run custom hooks, which isn't always available. This
commit adds GitPoller as an option.

Signed-off-by: California Sullivan <california.l.sullivan at intel.com>
---
 lib/python2.7/site-packages/autobuilder/Autobuilder.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/python2.7/site-packages/autobuilder/Autobuilder.py b/lib/python2.7/site-packages/autobuilder/Autobuilder.py
index 32c6128..0dae5dc 100644
--- a/lib/python2.7/site-packages/autobuilder/Autobuilder.py
+++ b/lib/python2.7/site-packages/autobuilder/Autobuilder.py
@@ -230,14 +230,26 @@ class Autobuilder:
                         if value.has_key('change-password'):
                             passwd=value['change-password']
 
-                        self.yocto_sources.append(PBChangeSource(user=user, passwd=passwd))
-
                         branch="master"
                         stabletimer=60
                         if repo.has_key('branch'):
                             branch = repo['branch']
                         if value.has_key('stable-timer'):
                             stabletimer = value['stable-timer']
+
+                        if value.has_key('changesource') and value['changesource'] == 'GitPoller':
+                            if value.has_key('interval'):
+                                interval = int(value['interval'])
+                            else:
+                                # default to 5 minutes poll intervals
+                                interval = 60*5
+                            self.yocto_sources.append(GitPoller(repourl=repo['repourl'], branch=branch, pollInterval=interval))
+                            log.msg("Adding GitPoller as changesource for " + reponame)
+                        else:
+                            # default to use PBChangeSource as the changesource
+                            self.yocto_sources.append(PBChangeSource(user=user, passwd=passwd))
+                            log.msg("Adding PBChangeSource as changesource for " + reponame)
+
                         self.yocto_sched.append(SingleBranchScheduler(name=str(name),
                                                                       builderNames=['%s' % key],
                                                                       properties=checkoutprops,
-- 
1.9.3




More information about the yocto mailing list