How to put any file in artifactory using python?

亡梦爱人 提交于 2019-12-06 00:06:06

Artifactory python module can be used to upload artifacts into artifactory. https://pypi.python.org/pypi/artifactory/0.1.17

Here is an example from the website used to upload a file into artifactory:

from artifactory import ArtifactoryPath
path = ArtifactoryPath("http://my-artifactory/artifactory/libs-snapshotlocal/myapp/1.0")
path.mkdir()

path.deploy_file('./myapp-1.0.tar.gz')

The defend against fruit project provides the integration with Artifactory and Python you are looking for. http://teamfruit.github.io/defend_against_fruit/

Artifactory exposes a REST API. Here's a link to the documentation. See the section on "Deploy Artifact".

Basically you will need to build a REST client. There might already exist one for Artifactory? If you need to write it yourself there is a WADL file that might make things easier (see also wadllib).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!