Skip to content

Commit

Permalink
Merge pull request #72 from release-engineering/add-staged-source
Browse files Browse the repository at this point in the history
Adds information on staged source
  • Loading branch information
jajreidy authored Nov 6, 2024
2 parents 26af934 + 4268b6d commit 68fc64a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 6 deletions.
10 changes: 10 additions & 0 deletions docs/combined_push.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ A typical invocation of push would look like this:
--credentials PATH_TO_CREDS_1.json,PATH_TO_CREDS_2.json \
koji:https://koji.example.com/kojihub?vmi_build=build-example1,build-example2
using a staged source

.. code-block::
pubtools-marketplacesvm-push \
--workflow all \
--starmap-url https://starmap.example.com \
--credentials PATH_TO_CREDS_1.json,PATH_TO_CREDS_2.json \
staged:/direct/path/to/folder
.. include:: common/credentials.rst
.. include:: common/sources.rst
Expand Down
7 changes: 6 additions & 1 deletion docs/common/sources.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Supported Sources
------------------

The tooling supports the `KojiSource`_ and `ErrataSource`_ from ``pushsource``.
The tooling supports the `KojiSource`_ , `ErrataSource`_ , and `StagedSource`_ from ``pushsource``.

All the VM images in the given source path will be uploaded
to the corresponding cloud provider and published to its marketplace.
Expand All @@ -14,6 +14,11 @@ The expected parameter for the VM images is ``vmi_build``:
koji:https://koji.example.com/kojihub?vmi_build=build-example1,build-example2
.. code-block::
staged:/direct/path/to/folder
.. _KojiSource: https://release-engineering.github.io/pushsource/sources/koji.html#accessing-virtual-machine-images
.. _ErrataSource: https://release-engineering.github.io/pushsource/sources/errata.html
.. _StagedSource: https://release-engineering.github.io/pushsource/sources/staged.html
10 changes: 10 additions & 0 deletions docs/community_push.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ A typical invocation of push would look like this:
koji:https://koji.example.com/kojihub?vmi_build=build-example1,build-example2
using a staged sourced

.. code-block::
pubtools-marketplacesvm-community-push \
--starmap-url https://starmap.example.com \
--credentials PATH_TO_CREDS_1.json,PATH_TO_CREDS_2.json \
staged:/direct/path/to/folder
.. include:: common/credentials.rst
.. include:: common/sources.rst
.. include:: common/mappings.rst
9 changes: 9 additions & 0 deletions docs/marketplace_push.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ A typical invocation of push would look like this:
--credentials PATH_TO_CREDS_1.json,PATH_TO_CREDS_2.json \
koji:https://koji.example.com/kojihub?vmi_build=build-example1,build-example2
or using a staged source

.. code-block::
pubtools-marketplacesvm-marketplace-push \
--starmap-url https://starmap.example.com \
--credentials PATH_TO_CREDS_1.json,PATH_TO_CREDS_2.json \
staged:/direct/path/to/folder
.. include:: common/credentials.rst
.. include:: common/sources.rst
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cloudimg>=1.14.0
pubtools>=1.3.0
more_executors>=2.11.4
pushcollector>=1.3.0
pushsource>=2.47.2
pushsource>=2.48.1
strenum>=0.4.15
starmap-client>=2.1.0
cloudpub>=1.2.1
4 changes: 3 additions & 1 deletion src/pubtools/_marketplacesvm/tasks/push/items/starmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def _update_push_item_properties(

def _map_push_item(self, destinations: List[Destination]) -> VMIPushItem:
"""Return the wrapped push item with the missing attributes set."""
if self.push_item.dest: # If it has destinations it means we already mapped its properties
if (
self.push_item.dest and "starmap" not in self.push_item.dest
): # If it has destinations it means we already mapped its properties
# Just update the destinations for the marketplace and return
self.push_item = evolve(self.push_item, dest=destinations)
return self.push_item
Expand Down
6 changes: 3 additions & 3 deletions tests/push/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def release_params() -> Dict[str, Any]:


@pytest.fixture
def push_item_params() -> Dict[str, str]:
def push_item_params() -> Dict[str, Any]:
return {
"name": "name",
"description": "",
Expand All @@ -55,10 +55,10 @@ def vhd_push_item(release_params: Dict[str, Any], push_item_params: Dict[str, st


@pytest.fixture
def ami_push_item(release_params: Dict[str, Any], push_item_params: Dict[str, str]) -> AmiPushItem:
def ami_push_item(release_params: Dict[str, Any], push_item_params: Dict[str, Any]) -> AmiPushItem:
"""Return a minimal AmiPushItem."""
release = AmiRelease(**release_params)
push_item_params.update({"name": "ami_pushitem", "release": release})
push_item_params.update({"name": "ami_pushitem", "release": release, "dest": ["starmap"]})
return AmiPushItem(**push_item_params)


Expand Down

0 comments on commit 68fc64a

Please sign in to comment.