Beispiel #1
0
def main():
    parser = argparse.ArgumentParser(
        description="Cross Linux Uniform Mutual Packager")
    parser.add_argument('clumpath', help="Path to source clump directory")
    srcpath = parser.parse_args().clumpath
    if os.path.isdir(srcpath):
        srcpath = clump_dir_to_tarball(srcpath)
    clump = clumpball_info(srcpath)
    tarpath = join(backend.tarball_dest(), clump.tarfilename)
    if not os.path.exists(tarpath) or not os.path.samefile(srcpath, tarpath):
        shutil.copy(srcpath, tarpath)
    backend.build(clump)
Beispiel #2
0
def main():
  parser = argparse.ArgumentParser(
    description="Cross Linux Uniform Mutual Packager")
  parser.add_argument('clumpath',
                      help="Path to source clump directory")
  srcpath = parser.parse_args().clumpath
  if os.path.isdir(srcpath):
    srcpath = clump_dir_to_tarball(srcpath)
  clump = clumpball_info(srcpath)
  tarpath = join(backend.tarball_dest(), clump.tarfilename)
  if not os.path.exists(tarpath) or not os.path.samefile(srcpath, tarpath):
    shutil.copy(srcpath, tarpath)
  backend.build(clump)
Beispiel #3
0
def run():
    config = Config()
    config.from_object('configs.default')

    setup_logging(config)
    setup_database(config.get('DB_PATH'))
    setup_items(config.get('ITEMS_CONF'))

    backend_app = backend.build(**config)
    backend_app.run()

    frontend_app = frontend.build(**config)
    frontend_app.run()

    tornado.ioloop.IOLoop.instance().start()
Beispiel #4
0
    logging.error("This payload does not carry a release... aborting.")
    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')
Beispiel #5
0
    logging.error("This payload does not carry a release... aborting.")
    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)
from fs.errors import ResourceNotFoundError
import settings as s
from backend import fetch_repo, create_production, build
from utils import load_repos

root_fs = OSFS(s.root_path)
build_fs = root_fs.makeopendir(s.build_path)
build_fs.makedir(s.sources_path)
build_fs.makedir(s.staging_path)
build_fs.makedir(s.register_path)

# create production directory if needed
try:
    production_fs = OSFS(s.production_path)
except ResourceNotFoundError:
    # grap production dir's parent dir
    path = s.production_path.split('/')[-2]
    print path
    production_fs = OSFS(s.production_path[:len(s.production_path) - (len(path) + 1)]).makeopendir(path)
    print production_fs

if production_fs.exists(s.backups_path) == False:
    production_fs.makedir(s.backups_path)

# fetch repos from GitHub
for repo in load_repos(s.repos_path)[0].values():
    print 'Fetching %s for the first time' % repo['id']
    fetch_repo(root_fs, s.sources_path, repo['id'], repo['url'], s.build_path)
    build(s.sources_path, s.register_path, root_fs, repo['id'])

create_production(s.register_path, s.backups_path, s.script_entry_path, s.production_path)