Exemplo n.º 1
0
from builders. This is useful if you want to use these Buildsteps separate from
a Buildbot master.
"""

# pylint: disable=C0323,R0201

import os
import re
import sys

from common import chromium_utils

# slaves are currently set to buildbot 0.7, while masters to 0.8
# these are required to override 0.7 and are necessary until slaves
# have been transitioned to 0.8
chromium_utils.AddThirdPartyLibToPath('buildbot_8_4p1', override=True)
chromium_utils.AddThirdPartyLibToPath('buildbot_slave_8_4', override=True)
chromium_utils.AddThirdPartyLibToPath('twisted_10_2', override=True)
chromium_utils.AddThirdPartyLibToPath('sqlalchemy_0_7_1', override=True)
chromium_utils.AddThirdPartyLibToPath('sqlalchemy_migrate_0_7_1',
                                      override=True)
chromium_utils.AddThirdPartyLibToPath('jinja2', override=True)
chromium_utils.AddThirdPartyLibToPath('decorator_3_3_1', override=True)
chromium_utils.AddThirdPartyLibToPath('requests_1_2_3', override=True)

from buildbot.process import base
from buildbot.process import builder as real_builder
from buildbot.process.properties import Properties
from buildbot.status import build as build_module
from buildbot.status import builder
from buildbot.status.results import EXCEPTION
Exemplo n.º 2
0
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import argparse
import sys

from common import chromium_utils

chromium_utils.AddThirdPartyLibToPath('requests_1_2_3')

import requests  # "Unable to import" pylint: disable=F0401


def main():
  parser = argparse.ArgumentParser(
      description='Get a url and print its document.')
  parser.add_argument('url', help='the url to fetch')
  parser.add_argument('--outfile', help='write output to this file')
  args = parser.parse_args()

  r = requests.get(args.url)
  r.raise_for_status()

  if args.outfile:
    with open(args.outfile, 'w') as f:
      f.write(r.text)
  else:
    print r.text
Exemplo n.º 3
0
import os
import optparse
import sys
import traceback

BASE_DIR = os.path.abspath(
    os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir,
                 os.pardir))

sys.path.insert(0, os.path.join(BASE_DIR, 'scripts'))

from common import chromium_utils

# this is required for master.cfg to be loaded properly, since setuptools
# is only required by runbuild.py at the moment.
chromium_utils.AddThirdPartyLibToPath('setuptools-0.6c11')


@contextlib.contextmanager
def TemporaryMasterPasswords():
    all_paths = [os.path.join(BASE_DIR, 'site_config', '.bot_password')]
    all_paths.extend(
        os.path.join(path, '.apply_issue_password')
        for path in chromium_utils.ListMasters())
    created_paths = []
    for path in all_paths:
        if not os.path.exists(path):
            try:
                with open(path, 'w') as f:
                    f.write('reindeer flotilla\n')
                created_paths.append(path)