I am trying to upload packages (APT,YUM,PYPI,RAW,DOCKER) to nexus using python. I have only find a way to upload maven packages. I would like to upload some other formats of packages using similar scripts as below example for maven.
Thank you for this Niko. I used your code as a reference, but instead of ending up with the actual package.tar.gz file in e.g. repository/hosted-raw/packages/raw I have a text file containing the path & filename. Can you confirm your package is uploaded successfully or if you also just have a text file? Thanks again and good work.
Edit:
I came across this post and had to do the following:
This got mine working, but only for text-based files (meaning now it’s the proper contents inside, rather than just the path/filename.ext inside). I’m getting <Response [500]> for binary files. I’m still pretty new to python but I suspect it’s the way I’m opening the file, or maybe open isn’t the function I need. I’ll update this thread if I figure it out.