コード例 #1
0
    # We want this to be logged to the log file (if any).
    if project_config:
        if project_config.get('disabled'):
            logger.info("Project {} disabled, exiting".
                        format(args.project))
            sys.exit(2)

    lock = filelock.FileLock(os.path.join(tempfile.gettempdir(),
                             args.project + "-mirror.lock"))
    try:
        with lock.acquire(timeout=0):
            proxy = config.get('proxy') if use_proxy else None
            if prehook:
                logger.info("Running pre hook")
                if run_hook(logger, prehook,
                            os.path.join(source_root, args.project), proxy,
                            hook_timeout) != 0:
                    logger.error("pre hook failed")
                    logging.shutdown()
                    sys.exit(1)

            #
            # If one of the repositories fails to sync, the whole project sync
            # is treated as failed, i.e. the program will return 1.
            #
            for repo_path in get_repos(logger, args.project, messages_file):
                logger.debug("Repository path = {}".format(repo_path))

                if repo_path in ignored_repos:
                    logger.info("repository {} ignored".format(repo_path))
                    continue
コード例 #2
0
ファイル: mirror.py プロジェクト: kahatlen/OpenGrok
        #
        logger.addHandler(handler)

    # We want this to be logged to the log file (if any).
    if project_config:
        if project_config.get('disabled'):
            logger.info("Project {} disabled, exiting".
                        format(args.project))
            sys.exit(2)

    lock = filelock.FileLock(os.path.join(tempfile.gettempdir(),
                             args.project + "-mirror.lock"))
    try:
        with lock.acquire(timeout=0):
            if prehook and run_hook(logger, prehook,
                                    os.path.join(source_root,
                                                 args.project)) != 0:
                logger.error("pre hook failed")
                logging.shutdown()
                sys.exit(1)

            #
            # If one of the repositories fails to sync, the whole project sync
            # is treated as failed, i.e. the program will return 1.
            #
            for repo_path in get_repos(logger, args.project, messages_file):
                logger.debug("Repository path = {}".format(repo_path))

                if repo_path in ignored_repos:
                    logger.debug("repository {} ignored".format(repo_path))
                    continue
コード例 #3
0
    # We want this to be logged to the log file (if any).
    if project_config:
        if project_config.get('disabled'):
            logger.info("Project {} disabled, exiting".
                        format(args.project))
            sys.exit(2)

    lock = filelock.FileLock(os.path.join(tempfile.gettempdir(),
                             args.project + "-mirror.lock"))
    try:
        with lock.acquire(timeout=0):
            if prehook:
                logger.info("Running pre hook")
                if run_hook(logger, prehook,
                            os.path.join(source_root, args.project),
                            config['proxy'] if use_proxy else None,
                            hook_timeout) != 0:
                    logger.error("pre hook failed")
                    logging.shutdown()
                    sys.exit(1)

            #
            # If one of the repositories fails to sync, the whole project sync
            # is treated as failed, i.e. the program will return 1.
            #
            for repo_path in get_repos(logger, args.project, messages_file):
                logger.debug("Repository path = {}".format(repo_path))

                if repo_path in ignored_repos:
                    logger.info("repository {} ignored".format(repo_path))
                    continue
コード例 #4
0
ファイル: mirror.py プロジェクト: yutuer/opengrok
        # rotation in the future.
        #
        logger.addHandler(handler)

    # We want this to be logged to the log file (if any).
    if project_config:
        if project_config.get('disabled'):
            logger.info("Project {} disabled, exiting".format(args.project))
            sys.exit(2)

    lock = filelock.FileLock(
        os.path.join(tempfile.gettempdir(), args.project + "-mirror.lock"))
    try:
        with lock.acquire(timeout=0):
            if prehook and run_hook(logger, prehook,
                                    os.path.join(source_root,
                                                 args.project)) != 0:
                logger.error("pre hook failed")
                logging.shutdown()
                sys.exit(1)

            #
            # If one of the repositories fails to sync, the whole project sync
            # is treated as failed, i.e. the program will return 1.
            #
            for repo_path in get_repos(logger, args.project, messages_file):
                logger.debug("Repository path = {}".format(repo_path))

                if repo_path in ignored_repos:
                    logger.debug("repository {} ignored".format(repo_path))
                    continue