Exemple #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
Exemple #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
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)