Exemple #1
1
    def __init__(self,
                 configfile,
                 pulse_authfile,
                 debug,
                 log_folder,
                 logger,
                 message=None,
                 display_only=False):

        self.config = JSONFile(configfile).read()
        self.debug = debug
        self.log_folder = log_folder
        self.logger = logger
        self.display_only = display_only
        self.test_message = message

        self.jenkins = jenkins.Jenkins(self.config['jenkins']['url'],
                                       self.config['jenkins']['username'],
                                       self.config['jenkins']['password'])

        # When a local pulse message is used, return immediately
        if self.test_message:
            data = JSONFile(self.test_message).read()
            self.on_build(data)
            return

        # Load Pulse Guardian authentication from config file
        if not os.path.exists(pulse_authfile):
            print 'Config file for Mozilla Pulse does not exist!'
            return

        pulse_cfgfile = ConfigParser.ConfigParser()
        pulse_cfgfile.read(pulse_authfile)
        pulse_cfg = PulseConfiguration.read_from_config(pulse_cfgfile)

        label = '%s/%s' % (socket.getfqdn(), self.config['pulse']['applabel'])
        self.monitor = start_pulse_monitor(
            buildCallback=self.on_build,
            testCallback=None,
            pulseCallback=self.on_debug if self.debug else None,
            label=label,
            trees=self.config['pulse']['branches'],
            platforms=self.config['pulse']['platforms'],
            products=self.config['pulse']['products'],
            buildtypes=None,
            tests=None,
            buildtags=self.config['pulse']['tags'],
            logger=self.logger,
            pulse_cfg=pulse_cfg)

        try:
            while self.monitor.is_alive():
                self.monitor.join(1.0)
        except (KeyboardInterrupt, SystemExit):
            self.logger.info('Shutting down Pulse listener')
Exemple #2
0
def main():
    if not os.path.exists("builds.ini"):
        open("builds.ini", "wb")
    # Start our pulse listener for the birch builds
    pulsemonitor = start_pulse_monitor(buildCallback=on_build,
                                            tree=["birch"],
                                            platform=["linux-android"],
                                            mobile=False,
                                            buildtype="opt"
                                            )
    pulsemonitor.join()
def main():
    if len(sys.argv) != 2:
        sys.exit("Please pass in the platform of the current system (ex: linux, win32, ...)")
    platform = sys.argv[1]
    pr = ProfilerRunner(platform)
    monitor = start_pulse_monitor(buildCallback=pr.start,
                                  testCallback=None,
                                  pulseCallback=None,
                                  label="Profiler-" + socket.gethostname(),
                                  tree=['mozilla-central'],
                                  platform=platform,
                                  mobile=False,
                                  buildtype=None,
                                  logger="Profiler")
    monitor.join()
Exemple #4
0
    def __init__(self,
                 config,
                 debug,
                 log_folder,
                 logger,
                 message=None,
                 display_only=False):

        self.config = config
        self.debug = debug
        self.log_folder = log_folder
        self.logger = logger
        self.display_only = display_only
        self.test_message = message

        self.jenkins = jenkins.Jenkins(self.config['jenkins']['url'],
                                       self.config['jenkins']['username'],
                                       self.config['jenkins']['password'])

        # Whenever only a single message has to be sent we can return immediately
        if self.test_message:
            data = JSONFile(self.test_message).read()
            self.on_build(data)
            return

        # Make the consumer dependent to the host to prevent queue corruption by
        # other machines which are using the same queue name
        label = '%s|%s' % (self.config['pulse']['applabel'], socket.getfqdn())

        self.monitor = start_pulse_monitor(
            buildCallback=self.on_build,
            testCallback=None,
            pulseCallback=self.on_debug if self.debug else None,
            label=label,
            trees=self.config['pulse']['branches'],
            platforms=self.config['pulse']['platforms'],
            products=self.config['pulse']['products'],
            locales=self.config['pulse']['locales'],
            buildtypes=None,
            tests=None,
            buildtags=self.config['pulse']['tags'],
            logger=self.logger)

        try:
            while self.monitor.is_alive():
                self.monitor.join(1.0)
        except (KeyboardInterrupt, SystemExit):
            self.logger.info('Shutting down Pulse listener')
Exemple #5
0
    def __init__(self, configfile, pulse_authfile, debug, log_folder, logger,
                 message=None, display_only=False):

        self.config = JSONFile(configfile).read()
        self.debug = debug
        self.log_folder = log_folder
        self.logger = logger
        self.display_only = display_only
        self.test_message = message

        self.jenkins = jenkins.Jenkins(self.config['jenkins']['url'],
                                       self.config['jenkins']['username'],
                                       self.config['jenkins']['password'])

        # When a local pulse message is used, return immediately
        if self.test_message:
            data = JSONFile(self.test_message).read()
            self.on_build(data)
            return

        # Load Pulse Guardian authentication from config file
        if not os.path.exists(pulse_authfile):
            print 'Config file for Mozilla Pulse does not exist!'
            return

        pulse_cfgfile = ConfigParser.ConfigParser()
        pulse_cfgfile.read(pulse_authfile)
        pulse_cfg = PulseConfiguration.read_from_config(pulse_cfgfile)

        label = '%s/%s' % (socket.getfqdn(), self.config['pulse']['applabel'])
        self.monitor = start_pulse_monitor(buildCallback=self.on_build,
                                           testCallback=None,
                                           pulseCallback=self.on_debug if self.debug else None,
                                           label=label,
                                           trees=self.config['pulse']['branches'],
                                           platforms=self.config['pulse']['platforms'],
                                           products=self.config['pulse']['products'],
                                           buildtypes=None,
                                           tests=None,
                                           buildtags=self.config['pulse']['tags'],
                                           logger=self.logger,
                                           pulse_cfg=pulse_cfg)

        try:
            while self.monitor.is_alive():
                self.monitor.join(1.0)
        except (KeyboardInterrupt, SystemExit):
            self.logger.info('Shutting down Pulse listener')
Exemple #6
0
    def __init__(self, config, debug, log_folder, logger,
                 message=None, display_only=False):

        self.config = config
        self.debug = debug
        self.log_folder = log_folder
        self.logger = logger
        self.display_only = display_only
        self.test_message = message

        self.jenkins = jenkins.Jenkins(self.config['jenkins']['url'],
                                       self.config['jenkins']['username'],
                                       self.config['jenkins']['password'])

        # Whenever only a single message has to be sent we can return immediately
        if self.test_message:
            data = JSONFile(self.test_message).read()
            self.on_build(data)
            return

        # Make the consumer dependent to the host to prevent queue corruption by
        # other machines which are using the same queue name
        label = '%s|%s' % (self.config['pulse']['applabel'], socket.getfqdn())

        self.monitor = start_pulse_monitor(buildCallback=self.on_build,
                                           testCallback=None,
                                           pulseCallback=self.on_debug if self.debug else None,
                                           label=label,
                                           trees=self.config['pulse']['branches'],
                                           platforms=self.config['pulse']['platforms'],
                                           products=self.config['pulse']['products'],
                                           locales=self.config['pulse']['locales'],
                                           buildtypes=None,
                                           tests=None,
                                           buildtags=self.config['pulse']['tags'],
                                           logger=self.logger)

        try:
            while self.monitor.is_alive():
                self.monitor.join(1.0)
        except (KeyboardInterrupt, SystemExit):
            self.logger.info('Shutting down Pulse listener')