How to put any file in artifactory using python?

我只是一个虾纸丫 提交于 2020-01-13 14:02:00

问题


I have a requirement where any file should be put in the artifact using python language. I tried to search all over internet but I couldn't find any help.

Please share code snippet or something which can help me to achieve this.

Any help is greatly appreciated here.


回答1:


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')



回答2:


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




回答3:


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).



来源:https://stackoverflow.com/questions/11514693/how-to-put-any-file-in-artifactory-using-python

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