Beispiel #1
0
def test_tarball_generation_local_repo(tmpdir):
    if MOCK:
        mock_docker()
    b = BuildImageBuilder(reactor_local_path=PARENT_DIR)
    tarball_path = b.get_reactor_tarball_path(str(tmpdir))
    assert os.path.exists(tarball_path)
    assert len(glob(os.path.join(str(tmpdir), 'atomic-reactor-*.tar.gz'))) == 1
Beispiel #2
0
def test_tarball_generation_upstream_repo(tmpdir):
    if MOCK:
        mock_docker()
    b = BuildImageBuilder(use_official_reactor_git=True)
    tarball_path = b.get_reactor_tarball_path(str(tmpdir))
    assert os.path.exists(tarball_path)
    assert len(glob(os.path.join(str(tmpdir), 'atomic-reactor-*.tar.gz'))) == 1
def test_tarball_generation_upstream_repo(tmpdir):
    if MOCK:
        mock_docker()
    b = BuildImageBuilder(use_official_reactor_git=True)
    tarball_path = b.get_reactor_tarball_path(str(tmpdir))
    assert os.path.exists(tarball_path)
    assert len(glob(os.path.join(str(tmpdir), 'atomic-reactor-*.tar.gz'))) == 1
def test_tarball_generation_local_repo(tmpdir):
    if MOCK:
        mock_docker()
    b = BuildImageBuilder(reactor_local_path=PARENT_DIR)
    tarball_path = b.get_reactor_tarball_path(str(tmpdir))
    assert os.path.exists(tarball_path)
    assert len(glob(os.path.join(str(tmpdir), 'atomic-reactor-*.tar.gz'))) == 1
Beispiel #5
0
def test_image_creation_local_repo():
    if MOCK:
        mock_docker()

    b = BuildImageBuilder(reactor_local_path=PARENT_DIR)
    df_dir_path = os.path.join(PARENT_DIR, 'images', 'privileged-builder')
    b.create_image(df_dir_path, TEST_BUILD_IMAGE)

    dt = DockerTasker()
    assert dt.image_exists(TEST_BUILD_IMAGE)
    dt.remove_image(TEST_BUILD_IMAGE)
Beispiel #6
0
def cli_create_build_image(args):
    b = BuildImageBuilder(reactor_tarball_path=args.reactor_tarball_path,
                          reactor_local_path=args.reactor_local_path,
                          reactor_remote_path=args.reactor_remote_git,
                          use_official_reactor_git=args.reactor_latest)
    try:
        b.create_image(args.dockerfile_dir_path, args.image, use_cache=args.use_cache)
    except RuntimeError:
        logger.error("build failed")
        sys.exit(1)
    sys.exit(0)
Beispiel #7
0
def cli_create_build_image(args):
    b = BuildImageBuilder(reactor_tarball_path=args.reactor_tarball_path,
                          reactor_local_path=args.reactor_local_path,
                          reactor_remote_path=args.reactor_remote_git,
                          use_official_reactor_git=args.reactor_latest)
    try:
        b.create_image(args.dockerfile_dir_path, args.image, use_cache=args.use_cache)
    except RuntimeError:
        logger.error("build failed")
        sys.exit(1)
    sys.exit(0)
def test_image_creation_local_repo():
    if MOCK:
        mock_docker()

    b = BuildImageBuilder(reactor_local_path=PARENT_DIR)
    df_dir_path = os.path.join(PARENT_DIR, 'images', 'privileged-builder')
    b.create_image(df_dir_path, TEST_BUILD_IMAGE)

    dt = DockerTasker()
    assert dt.image_exists(TEST_BUILD_IMAGE)
    dt.remove_image(TEST_BUILD_IMAGE)
Beispiel #9
0
def setup_module(module):
    if MOCK:
        return

    b = BuildImageBuilder(reactor_local_path=reactor_root)
    b.create_image(os.path.join(reactor_root, 'images', 'privileged-builder'),
                   PRIV_BUILD_IMAGE, use_cache=True)

    b2 = BuildImageBuilder(reactor_local_path=reactor_root)
    b2.create_image(os.path.join(reactor_root, 'images', 'dockerhost-builder'),
                    DH_BUILD_IMAGE, use_cache=True)
Beispiel #10
0
def setup_module(module):
    global PRIV_BUILD_IMAGE, DH_BUILD_IMAGE
    PRIV_BUILD_IMAGE = get_uuid()
    DH_BUILD_IMAGE = get_uuid()
    if MOCK:
        return

    b = BuildImageBuilder(reactor_local_path=reactor_root)
    b.create_image(os.path.join(reactor_root, 'images', 'privileged-builder'),
                   PRIV_BUILD_IMAGE, use_cache=True)

    b2 = BuildImageBuilder(reactor_local_path=reactor_root)
    b2.create_image(os.path.join(reactor_root, 'images', 'dockerhost-builder'),
                    DH_BUILD_IMAGE, use_cache=True)