コード例 #1
0
ファイル: run.py プロジェクト: fterpstra/technisch-register
def build(source, build_dir, root, initiator):
    logging.info("Sync script started by %s...", initiator)

    # TODO: use this approach to include standards that are not managed on GitHub
    #standards = OSFS(source).listdir(dirs_only=True)
        
    # check if initiator is present in repos.json
    if initiator in standards_id.keys():
        cleanup(source, build_dir, initiator)

        logging.info("Fetching repo %s..." % initiator)
        backend.fetch_repo(root, initiator, standards_id[initiator]['url'], build_dir)
        
        logging.info("Building folders...")
        backend.build_folders(source, build_dir, standards_id[initiator], root)
        
        logging.info("Creating overview page...")
        webpages.create_overview_page(standards, source, build_dir)
    else:
        print "%s is not listed in repos.json... aborting." % initiator
        logging.error("%s is not listed in repos.json... aborting" % initiator)
        exit()
        #TODO: check if repo needs to be removed from repos/

    print "Done!"
コード例 #2
0
ファイル: build.py プロジェクト: wilkoquak/technisch-register
def build_staging(source, destination_temp, destination):
    set_repeat('none')

    cleanup(source, destination_temp)

    root = OSFS('./') # 'c:\Users\<login name>' on Windows
    # root.makedir(source, allow_recreate=True)
    root.makedir(destination_temp, allow_recreate=True)

    # TODO: use this approach to include standards that are not managed on GitHub
    #standards = OSFS(source).listdir(dirs_only=True)
    with open('repos-dev.json') as f:
        standards = load(f)
    
    backend.fetch_repos(root, destination_temp, standards, source)
    backend.build_folders(source, destination_temp, standards, root)
    webpages.create_overview_page(standards, source, destination_temp)
    backend.create_staging(destination_temp, destination)
    
    print "Done!"