예제 #1
0
def maybe_build_base_devel():
    """


    :return:
    """
    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.
    status.current_status = 'Docker images are stale. Building new images.'
    build_script = os.path.join(DOC_DIR, 'base-devel.sh')
    build_it = False
    try:
        build_it = subprocess.check_output([build_script])
    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:
        try:
            # Image was built successfully. Push it to docker hub.
            push_to_hub('antergos/archlinux-base-devel')
        except Exception:
            pass
        mpkg = build_makepkg()
        if not mpkg:
            return False
        db.setex('antbs:docker-images:base-devel:built-today', 84600, 'True')
        return True
    else:
        return False
예제 #2
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
예제 #3
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
예제 #4
0
def maybe_build_mkarchiso():
    """


    :return:
    """
    if db.exists('antbs:docker-images:mkarchiso:built-today'):
        return True

    # No image was built in the past 24 hours, let's build one.
    status.current_status = 'Docker images are stale. Building new images.'

    archiso = build_mkarchiso()

    if not archiso or archiso is None:
        return False

    db.setex('antbs:docker-images:mkarchiso:built-today', 84600, 'True')

    return True