diff --git a/docs/combined_push.rst b/docs/combined_push.rst index a7a13537..e531f8fd 100644 --- a/docs/combined_push.rst +++ b/docs/combined_push.rst @@ -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 diff --git a/docs/common/sources.rst b/docs/common/sources.rst index e8d9042c..6374fbc3 100644 --- a/docs/common/sources.rst +++ b/docs/common/sources.rst @@ -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. @@ -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 diff --git a/docs/community_push.rst b/docs/community_push.rst index 19ef3057..d2ca60b7 100644 --- a/docs/community_push.rst +++ b/docs/community_push.rst @@ -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 diff --git a/docs/marketplace_push.rst b/docs/marketplace_push.rst index 44dac484..64609114 100644 --- a/docs/marketplace_push.rst +++ b/docs/marketplace_push.rst @@ -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 diff --git a/requirements.txt b/requirements.txt index 98e7bc09..a1d86e3b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/src/pubtools/_marketplacesvm/tasks/push/items/starmap.py b/src/pubtools/_marketplacesvm/tasks/push/items/starmap.py index 7e09af55..d3016ad9 100644 --- a/src/pubtools/_marketplacesvm/tasks/push/items/starmap.py +++ b/src/pubtools/_marketplacesvm/tasks/push/items/starmap.py @@ -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 diff --git a/tests/push/conftest.py b/tests/push/conftest.py index 16f3f91a..1722857d 100644 --- a/tests/push/conftest.py +++ b/tests/push/conftest.py @@ -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": "", @@ -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)