pulp / pulpcore

Pulp 3 pulpcore package https://pypi.org/project/pulpcore/
GNU General Public License v2.0
307 stars 116 forks source link

Uploading rpm packages #5777

Open MikhailShapovalov26 opened 2 months ago

MikhailShapovalov26 commented 2 months ago

Good afternoon. I would like to ask you for help, I can't figure out how to work with downloading rpm packages. I'm trying to do it this way,

set -ex
while read RPM_NAME; do
        echo upload ${RPM_NAME}
        SHA256=`pulp artifact upload --file ${RPM_NAME} | jq -r .sha256`
        PULP_HREF=`pulp rpm content create --sha256 ${SHA256} --relative-path ${RPM_NAME} | jq -r .pulp_href`
        echo ${PULP_HREF}
        pulp rpm repository content add --repository dev --package-href ${PULP_HREF}
        PUBLICATION=`pulp rpm publication create --repository dev  | jq -r .pulp_href`
        pulp rpm distribution update --publication "${PUBLICATION}" --base-path dev --name dev
       done < <(find ./ -type f -name "*.rpm")

But in the end I get that the package has been sent and is there

 pulp rpm repository show --name dev | jq '.latest_version_href'
"/pulp/api/v3/repositories/rpm/rpm/0191d628-ecb4-74b6-bc4a-fdae38fddc49/versions/1/"
pulp rpm repository content list --repository dev | jq '.[].location_href'
Not all 1 entries were shown.
"./zebra-0.1-2.noarch.rpm"
, but I don't see it in the web interface.

[../](...../pulp/content/dev/)
[./](....../pulp/content/dev/Packages/)                                                                                                  09-Sep-2024 09:41  3.1 kB

What I'm doing wrong, I tried to do according to the documentation, but unfortunately it didn't bring any result. Thank you and I'm sorry for this question. I also tried as indicated here https://githubissues.com/pulp/pulp-cli/994, but I did not see my package in the web interface

gerrod3 commented 2 months ago

Do you already have a rpm distribution named dev? Try pulp rpm distribution list and see what shows up.

If you always want to distribute the latest publication of your dev repo, then I would update the distribution like this:

pulp rpm distribution update --name dev --repository dev  # Have the distro auto-distribute the latest publication 

Then you won't have to update this distribution anymore after uploads. Pulp will automatically serve the latest content from this path. Also, if you have pulp-cli 0.27 you can simplify the whole upload into this one command:

pulp rpm content upload --directory ./ --repository dev --use-temp-repository --publish
MikhailShapovalov26 commented 2 months ago

Thank you for your answer, I will definitely try, but a little later. @gerrod3