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!"
    exit()

# extract the release type: release or prerelease
prerelease = payload['release']['prerelease']
initiator = payload['repository']['name'].lower()

queue = FifoSQLiteQueue('queue.db')

if action == 'published':
    if prerelease == True:
        # check whether we can start the build.py script
        # i.e. whether another instance isn't already running
        if run():
            print "Building staging..."
            backend.build(source, staging_build, root, initiator)
            backend.create_staging(staging_build, production_path, build_path)
        else:
            print "Script is already running... setting repeat flag to staging..."
            # set_repeat('staging')
            queue.push(initiator, prerelease)
            exit()
    else:
        if run():
            print "Building production..."
            backend.build(source, register_path, root, initiator)
            backend.create_production(register_path, backups,
                                      script_entry_path, production_path)
        else:
            print "Script is already running... setting repeat flag to production..."
            # set_repeat('production')
            queue.push(initiator, prerelease)
    exit()

# extract the release type: release or prerelease
prerelease = payload['release']['prerelease']
initiator = payload['repository']['name'].lower()

queue = FifoSQLiteQueue('queue.db')

if action == 'published':
    if prerelease == True:
        # check whether we can start the build.py script
        # i.e. whether another instance isn't already running
        if run():
            print "Building staging..."
            backend.build(source, staging_build, root, initiator)
            backend.create_staging(staging_build, production_path, build_path)
        else:
            print "Script is already running... setting repeat flag to staging..."
            # set_repeat('staging')
            queue.push(initiator, prerelease)
            exit()
    else:
        if run():
            print "Building production..."
            backend.build(source, register_path, root, initiator)
            backend.create_production(register_path, backups, script_entry_path, production_path)
        else:
            print "Script is already running... setting repeat flag to production..."
            # set_repeat('production')
            queue.push(initiator, prerelease)
            exit()
Exemple #4
0
    exit()

# extract the release type: release or prerelease
prerelease = payload['release']['prerelease']
initiator = payload['repository']['name']

queue = FifoSQLiteQueue('queue.db')

if action == 'published':
    if prerelease == True:
        # check whether we can start the build.py script
        # i.e. whether another instance isn't already running
        if run():
            print "Building staging..."
            build(source, staging_build, root, initiator)
            backend.create_staging(staging_build)
        else:
            print "Script is already running... setting repeat flag to staging..."
            # set_repeat('staging')
            queue.push(initiator, prerelease)
            exit()
    else:
        if run():
            print "Building production..."
            build(source, production_build, root, initiator)
            backend.create_production(production_build, backups, script_dir)
        else:
            print "Script is already running... setting repeat flag to production..."
            # set_repeat('production')
            queue.push(initiator, prerelease)
            exit()