packer.py 文件源码

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

项目:builder 作者: elifesciences 项目源码 文件源码
def download_box(pname):
    "just download the vagrant .box for given project"
    boxurl = box_url(pname)
    if not boxurl.startswith('s3://'):
        print 'this task only downloads from s3. unhandled url', boxurl
        exit(1)
    dest = join('/tmp', os.path.basename(boxurl))
    if os.path.exists(dest):
        print 'file %s already exists, skipping download. move or rename the file to re-download' % dest
        return dest
    cmd = "aws s3 cp %s %s" % (boxurl, dest)
    assert local(cmd).return_code == 0, "failed to successfully download %s" % boxurl
    return dest
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号