build.py 文件源码

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

项目:deeppavlov 作者: deepmipt 项目源码 文件源码
def upload_model_to_nexus(project):
    """
    Use 'pyb -P model_name="<model_name>" upload_model_to_nexus' to upload archived model to Nexus repository
    of the lab. If model_name == 'deeppavlov_docs', then documentation from build/docs will be archived and uploaded.
    archive_model task will be executed before.
    """
    import requests, datetime
    os.chdir('build')
    model_name = project.get_property('model_name')
    file_name = model_name + '_' + datetime.date.today().strftime("%y%m%d") + '.tar.gz'
    url = 'http://share.ipavlov.mipt.ru:8080/repository/'
    url += 'docs/' if model_name == 'deeppavlov_docs' else 'models/'
    headers = {'Content-Type': 'application/binary'}
    with open(file_name, 'rb') as artifact:
        requests.put(url + model_name + '/' + file_name, headers=headers,
                     data=artifact, auth=('jenkins', 'jenkins123'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号