github.com/wmuizelaar/kpt@v0.0.0-20221018115725-bd564717b2ed/site/reference/cli/alpha/rpkg/clone/README.md (about)

     1  ---
     2  title: "`clone`"
     3  linkTitle: "clone"
     4  type: docs
     5  description: >
     6    Create a clone of an existing package revision.
     7  ---
     8  
     9  <!--mdtogo:Short
    10      Create a clone of an existing package revision.
    11  -->
    12  
    13  `clone` creates a new package revision by cloning an existing one. The
    14  new package revision will keep a reference to the source that can be used
    15  to pull in updates.
    16  
    17  ### Synopsis
    18  
    19  <!--mdtogo:Long-->
    20  
    21  ```
    22  kpt alpha rpkg clone SOURCE_PACKAGE_REV TARGET_PACKAGE_NAME [flags]
    23  ```
    24  
    25  #### Args
    26  
    27  ```
    28  SOURCE_PACKAGE_REV:
    29    The source package that will be cloned to create the new package revision.
    30    The types of sources are supported:
    31  
    32      * OCI: A URI to a OCI repository must be provided. 
    33        oci://oci-repository/package-name
    34      * Git: A URI to a git repository must be provided.
    35        https://git-repository.git/package-name
    36      * Package: The name of a package revision already available in the
    37        repository.
    38        blueprint-e982b2196b35a4f5e81e92f49a430fe463aa9f1a
    39  
    40  TARGET_PACKAGE_NAME:
    41    The name of the new package.
    42  
    43  ```
    44  
    45  #### Flags
    46  
    47  ```
    48  --directory
    49    Directory within the repository where the upstream
    50    package revision is located. This only applies if the source package is in git
    51    or oci.
    52  
    53  --ref
    54    Ref in the repository where the upstream package revision
    55    is located (branch, tag, SHA). This only applies when the source package
    56    is in git.
    57  
    58  --repository
    59    Repository to which package revision will be cloned
    60    (downstream repository).
    61  
    62  --revision
    63    Revision for the new package.
    64  
    65  --strategy
    66    Update strategy that should be used when updating the new
    67    package revision. Must be one of: resource-merge, fast-forward,  or 
    68    force-delete-replace. The default value is resource-merge.
    69  ```
    70  
    71  <!--mdtogo-->
    72  
    73  ### Examples
    74  
    75  <!--mdtogo:Examples-->
    76  
    77  ```shell
    78  # clone the blueprint-e982b2196b35a4f5e81e92f49a430fe463aa9f1a package and create a new package revision called
    79  # foo in the blueprint repository and set it at revision v1.
    80  $ kpt alpha rpkg clone blueprint-e982b2196b35a4f5e81e92f49a430fe463aa9f1a foo --repository blueprint --revision v1
    81  ```
    82  
    83  ```shell
    84  # clone the git repository at https://github.com/repo/blueprint.git at reference base/v0 and in directory base. The new
    85  # package revision will be created in repository blueprint and namespace default.
    86  $ kpt alpha rpkg clone https://github.com/repo/blueprint.git bar --repository=blueprint --ref=base/v0 --namespace=default --directory=base
    87  ```
    88  
    89  <!--mdtogo-->