Skip to content

Commit

Permalink
Move the structured repo docs into the upload section
Browse files Browse the repository at this point in the history
  • Loading branch information
quba42 committed Aug 30, 2023
1 parent bac0c0d commit 59775f3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 48 deletions.
1 change: 0 additions & 1 deletion docs/workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ Any workflows that cannot be achieved via Pulp CLI, will use ``httpie`` to talk
workflows/upload
workflows/publish
workflows/advanced_copy
workflows/structured_repo
workflows/checksums
34 changes: 0 additions & 34 deletions docs/workflows/structured_repo.rst

This file was deleted.

33 changes: 20 additions & 13 deletions docs/workflows/upload.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A working example for uploading a ``.deb`` package and hosting it in a ``pulp_de

.. code-block:: bash
NAME='quickstart-uploaded-vim-amd64'
NAME='quickstart-upload-vim-amd64'
pulp deb repository create --name=${NAME}
wget ftp.de.debian.org/debian/pool/main/v/vim/vim_9.0.1378-2_amd64.deb
pulp deb content upload --repository=${NAME} --file=vim_9.0.1378-2_amd64.deb
Expand All @@ -33,24 +33,31 @@ It follows we can configure our example repo in the ``/etc/apt/sources.list`` fi
deb http://<your_pulp_host>/pulp/content/quickstart-uploaded-vim-amd64/ pulp upload
.. note::
You can think of the upload command as declarative and idempotent.
In other words, you can upload the same package to your Pulp repository multiple times, and the task will succeed each time, but only the first time will result in any changes to your Pulp repository.

.. important::
It is possible to have an uploaded package added to an arbitrary distribution-component combination, by supplying the ``distribution`` and ``component`` parameters to the package upload API endpoint.
However, at the time of writing it is not possible to do this via Pulp CLI.
It is also not possible to use Pulp CLI to create a release content in order to customize the release file fields.


Create a Structured Repo Manually
--------------------------------------------------------------------------------

To get around Pulp CLI limitations from the quickstart example, we present the following scripted example that uses ``http`` and ``jq`` to talk directly to the API.

.. note::
You can think of the upload command as declarative and idempotent.
In other words, you can upload the same package to your Pulp repository multiple times, and the task will succeed each time, but only the first time will result in any changes to your Pulp repository.
You may also want to have a look at the `pulpcore upload documentation`_.

**Setup**

Limitations and Advanced Scenarios
--------------------------------------------------------------------------------
.. literalinclude:: ../_scripts/setup.sh
:language: bash

.. important::
The above workflow supplies the ``repository`` parameter to the package upload API endpoint.
Currently, this is the only workflow that will automatically create structure content to go with the uploaded package.
In other words, this is the only upload workflow, that will automatically place the uploaded package in a distribution-component combination in the target repository.
Alternative upload workflows will require you to either create structure content manually, or else publish using the ``simple=True`` publication workaround.
**Workflow**

There are many ways to upload and create arbitrary content in Pulp.
If you are interested in scripting (it will involve scripting) more advanced scenarios than the basic workflow above, have a look at the `pulpcore upload documentation`_.
.. literalinclude:: ../_scripts/structured_repo.sh
:language: bash

We also have an example on how to :ref:`manually create a structured repo with uploaded content <advanced_manual_upload>`.
The final command from the sctipt should return a ``200 OK`` response.

0 comments on commit 59775f3

Please sign in to comment.