Пример #1
0
def package(vcs='hg',
            all_deps="False",
            cert_file=DEFAULT_CERT,
            proxy_config=DEFAULT_PROXY,
            destroy_vm='False',
            vm='magma',
            os="debian"):
    """ Builds the magma package """
    all_deps = False if all_deps == "False" else True
    destroy_vm = bool(strtobool(destroy_vm))

    # If a host list isn't specified, default to the magma vagrant vm
    if not env.hosts:
        vagrant_setup(vm, destroy_vm=destroy_vm)

    if not hasattr(env, 'debug_mode'):
        print("Error: The Deploy target isn't specified. Specify one with\n\n"
              "\tfab [dev|test] package")
        exit(1)

    hash = pkg.get_commit_hash(vcs)

    with cd('~/magma/lte/gateway'):
        # Generate magma dependency packages
        run('mkdir -p ~/magma-deps')
        print('Generating lte/setup.py and orc8r/setup.py '
              'magma dependency packages')
        run('./release/pydep finddep --install-from-repo -b --build-output ' +
            '~/magma-deps' + (' -l ./release/magma.lockfile.%s' % os) +
            ' python/setup.py' + (' %s/setup.py' % ORC8R_AGW_PYTHON_ROOT))

        print('Building magma package, picking up commit %s...' % hash)
        run('make clean')
        build_type = "Debug" if env.debug_mode else "RelWithDebInfo"

        run('./release/build-magma.sh -h "%s" -t %s --cert %s --proxy %s --os %s'
            % (hash, build_type, cert_file, proxy_config, os))

        run('rm -rf ~/magma-packages')
        run('mkdir -p ~/magma-packages')
        try:
            run('cp -f ~/magma-deps/*.deb ~/magma-packages')
        except Exception:
            # might be a problem if no deps found, but don't handle here
            pass
        run('mv *.deb ~/magma-packages')

        with cd('release'):
            mirrored_packages_file = 'mirrored_packages'
            if vm and vm.startswith('magma_'):
                mirrored_packages_file += vm[5:]

            run('cat {}'.format(mirrored_packages_file) +
                ' | xargs -I% sudo aptitude download -q2 %')
            run('cp *.deb ~/magma-packages')
            run('sudo rm -f *.deb')

        if all_deps:
            pkg.download_all_pkgs()
            run('cp /var/cache/apt/archives/*.deb ~/magma-packages')
Пример #2
0
def package(vcs='hg',
            all_deps="False",
            cert_file=DEFAULT_CERT,
            proxy_config=DEFAULT_PROXY):
    """ Builds the magma package """
    all_deps = False if all_deps == "False" else True

    # If a host list isn't specified, default to the magma vagrant vm
    if not env.hosts:
        setup_env_vagrant()

    if not hasattr(env, 'debug_mode'):
        print("Error: The Deploy target isn't specified. Specify one with\n\n"
              "\tfab [dev|test] package")
        exit(1)

    hash = pkg.get_commit_hash(vcs)

    with cd('~/magma/lte/gateway'):
        print("Building magma package, picking up commit %s..." % hash)
        run('make clean')
        build_type = "Debug" if env.debug_mode else "RelWithDebInfo"
        run('./release/build-magma.sh -h "%s" -t %s --cert %s --proxy %s' %
            (hash, build_type, cert_file, proxy_config))

        # Generate magma dependency packages
        run('mkdir -p ~/magma-deps')
        print("Generating lte/setup.py magma dependency packages")
        run('./release/pydep finddep -b --build-output ~/magma-deps python/setup.py'
            )

        print("Generating orc8r/setup.py magma dependency packages")
        run('./release/pydep finddep -b --build-output ~/magma-deps %s/setup.py'
            % ORC8R_AGW_PYTHON_ROOT)

        run('rm -rf ~/magma-packages')
        run('mkdir -p ~/magma-packages')
        try:
            run('cp -f ~/magma-deps/*.deb ~/magma-packages')
        except Exception:
            # might be a problem if no deps found, but don't handle here
            pass
        run('mv *.deb ~/magma-packages')

        with cd('release'):
            run('cat mirrored_packages | '
                'xargs -I% sudo aptitude download -q2 %')
            run('cp *.deb ~/magma-packages')
            run('sudo rm -f *.deb')

        if all_deps:
            pkg.download_all_pkgs()
            run('cp /var/cache/apt/archives/*.deb ~/magma-packages')
Пример #3
0
def package(vcs='hg',
            all_deps="False",
            cert_file=DEFAULT_CERT,
            proxy_config=DEFAULT_PROXY):
    """ Builds the magma package """
    all_deps = False if all_deps == "False" else True

    # If a host list isn't specified, default to the magma vagrant vm
    if not env.hosts:
        setup_env_vagrant()

    if not hasattr(env, 'debug_mode'):
        print("Error: The Deploy target isn't specified. Specify one with\n\n"
              "\tfab [dev|test] package")
        exit(1)

    hash = pkg.get_commit_hash(vcs)

    with cd('~/magma/lte/gateway'):
        print("Building magma package, picking up commit %s..." % hash)
        run('make clean')
        build_type = "Debug" if env.debug_mode else "RelWithDebInfo"
        run('./release/build-magma.sh -h "%s" -t %s --cert %s --proxy %s' %
            (hash, build_type, cert_file, proxy_config))

        # Generate magma dependency packages
        print("Generating magma dependency packages")
        with cd('python'):
            run('../release/pydep finddep -b ../python/setup.py')
            run('mv *.deb ../')
        run('rm -rf ~/magma-packages')
        run('mkdir -p ~/magma-packages')
        run('mv *.deb ~/magma-packages')

        if all_deps:
            pkg.download_all_pkgs()
            run('cp /var/cache/apt/archives/*.deb ~/magma-packages')