Ejemplo n.º 1
0
def maybe_build_base_devel():
    if db.exists('antbs:docker-images:base-devel:built-today'):
        return True

    # No image was built in the past 24 hours, let's build one.
    build_script = os.path.join(DOC_DIR, 'base-devel.sh')
    build_it = False
    try:
        build_it = subprocess.check_output([build_script])
        shutil.rmtree('/opt/antergos-packages')
    except subprocess.CalledProcessError as err:
        logger.error('@@-docker_util.py-@@ | Image build script failed with error: %s', err.output)
        return False
    except shutil.Error as err2:
        logger(err2)

    if build_it:
        # Image was built successfully. Push it to docker hub.
        push_to_hub('antergos/archlinux-base-devel')
        mpkg = build_makepkg()
        if not mpkg:
            return False
        db.psetex('antbs:docker-images:base-devel:built-today', 304800000, 'True')
        return True
    else:
        return False
Ejemplo n.º 2
0
def maybe_build_mkarchiso():
    if db.exists('antbs:docker-images:mkarchiso:built-today'):
        return True

    archiso = build_mkarchiso()

    if not archiso or archiso is None:
        return False

    db.psetex('antbs:docker-images:mkarchiso:built-today', 304800000, 'True')

    return True