How to transfer artifact (file) to artifactory using URI

1,077 views
Skip to first unread message

Mateusz Pańczyszyn

unread,
Jul 9, 2021, 4:13:25 PM7/9/21
to Ansible Project
Hi,

I try to make small improvement in my CI. Normally is done by REST API and curl, for example (https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API)

curl -u myUser:ABcdEF -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt" -T Desktop/myNewFile.txt

I did translation from CURL but I cannot transfer file like above


- name: My test
uri:
url: https://myartifactory.net/artifactory/arc-generic-local/CI/mateusz_test/newfile
method: PUT
url_username: myuser
url_password: mypass
follow_redirects: all
validate_certs: no
status_code: 201

I tried with src flag and using body and form-multipart but without result. Could you help me with that?

Br,
Mateusz

Matt Martz

unread,
Jul 9, 2021, 4:18:30 PM7/9/21
to ansible...@googlegroups.com
Check out this comment, that describes how I was able to get this working:


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c8d40dd4-1cb8-4fd6-afd3-4caa7dda12e9n%40googlegroups.com.


--
Matt Martz
@sivel
sivel.net

Mateusz Pańczyszyn

unread,
Jul 9, 2021, 4:39:36 PM7/9/21
to Ansible Project
Thanks a lot Matt :) it's working also in my env. I could ask many hours ago but the most important is that is working fine. You save my time, because I got wrong idea to take output from "shell: curl [...]" and do logic for errors handling. Again: thanks and best wishes from Poland.
Reply all
Reply to author
Forward
0 new messages