def start_jenkins(): try: execfile(JENKINS_ENV, dict(__file__=JENKINS_ENV)) logger.info('Virtual environment activated successfully.') except Exception: logger.exception('Could not activate virtual environment at "%s"' % JENKINS_ENV) sys.exit(1) # do imports here because it requires the virtualenv to b activated from mozprocess.processhandler import ProcessHandler # Download the Jenkins WAR file if necessary if not os.path.exists(JENKINS_WAR): download_args = ['wget', JENKINS_URL, '-x', '-O', JENKINS_WAR] proc = ProcessHandler(download_args) proc.run() retval = proc.wait() if retval != 0: raise Exception('Failure downloading file "%s"' % JENKINS_URL) # TODO: Start Jenkins as daemon logger.info('Starting Jenkins') os.environ['JENKINS_HOME'] = os.path.join(HERE, 'jenkins-master') args = ['java', '-Xms2g', '-Xmx2g', '-XX:MaxPermSize=512M', '-Xincgc', '-jar', JENKINS_WAR] proc = ProcessHandler(args) proc.run() return proc
def start_jenkins(): try: execfile(JENKINS_ENV, dict(__file__=JENKINS_ENV)) print "Virtual environment activated successfully." except Exception as ex: print 'Could not activate virtual environment at "%s": %s.' % ( JENKINS_ENV, str(ex)) sys.exit(1) # do imports here because it requires the virtualenv to b activated from mozdownload import DirectScraper from mozprocess.processhandler import ProcessHandler # Download the Jenkins WAR file scraper = DirectScraper(url=JENKINS_URL, destination=JENKINS_WAR) scraper.download() # TODO: Start Jenkins as daemon print "Starting Jenkins" os.environ['JENKINS_HOME'] = os.path.join(HERE, 'jenkins-master') args = [ 'java', '-Xms2g', '-Xmx2g', '-XX:MaxPermSize=512M', '-Xincgc', '-jar', JENKINS_WAR ] proc = ProcessHandler(args) proc.run() return proc