buildman.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:boss 作者: kabirbaidhya 项目源码 文件源码
def delete_old_builds(history):
    ''' Auto delete unnecessary build directories from the filesystem. '''
    build_path = get_release_dir()
    kept_builds = map(lambda x: get_build_name(x['id']), history['builds'])
    found_builds = fs.glob(build_path)
    to_be_deleted_builds = [x for x in found_builds if x not in kept_builds]
    deletion_count = len(to_be_deleted_builds)

    # Skip, if there are no builds to be deleted.
    if deletion_count == 0:
        return

    # Remove directories to be deleted.
    with cd(build_path):
        fs.rm_rf(to_be_deleted_builds)
        remote_info(
            'Deleted {} old build(s) from the remote'.format(deletion_count)
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号