github.com/GoogleContainerTools/kpt@v1.0.0-beta.50.0.20240520170205-c25345ffcbee/site/book/08-package-orchestration/03-registering-a-repository.md (about)

     1  In the following sections of this chapter you will explore package authoring
     2  using Porch. You will need:
     3  
     4  * A GitHub repository for your blueprints. An otherwise empty repository with an
     5    initial commit works best. The initial commit is required to establish the
     6    `main` branch.
     7  * A GitHub [Personal Access Token](https://github.com/settings/tokens) with
     8    the `repo` scope for Porch to authenticate with the repository and allow it
     9    to create commits in the repository.
    10  
    11  A repository is a porch representation of either a git repo or an oci registry.
    12  Package revisions always belong to a single repository. A repository exists in
    13  a Kubernetes namespace and all package revisions in a repo also belong to
    14  the same namespace.
    15  
    16  Use the `kpt alpha repo register` command to register your repository with
    17  Porch: The command below uses the repository `deployments.git`.
    18  Your repository name may be different; please update the command with the
    19  correct repository name.
    20  
    21  ```sh
    22  # Register your Git repository:
    23  
    24  GITHUB_USERNAME=<GitHub Username>
    25  GITHUB_TOKEN=<GitHub Personal Access Token>
    26  REPOSITORY_ADDRESS=<Your Repository URL>
    27  
    28  $ kpt alpha repo register \
    29    --namespace default \
    30    --name deployments \
    31    --deployment \
    32    --repo-basic-username=${GITHUB_USERNAME} \
    33    --repo-basic-password=${GITHUB_TOKEN} \
    34    ${REPOSITORY_ADDRESS}
    35  ```
    36  
    37  And register the sample repository we used in the [quickstart](./02-quickstart):
    38  
    39  ```sh
    40  # Register the sample repository:
    41  
    42  kpt alpha repo register --namespace default \
    43    https://github.com/GoogleContainerTools/kpt-samples.git
    44  ```
    45  
    46  ?> Refer to the [register command reference][register-doc] for usage.
    47  
    48  You now have two repositories registered, and your repository is marked as
    49  deployment repository. This indicates that published packages in the repository
    50  are considered deployment-ready.
    51  
    52  ```sh
    53  # Query repositories registered with Porch:
    54  $ kpt alpha repo get
    55  NAME         TYPE  CONTENT  DEPLOYMENT  READY  ADDRESS
    56  deployments  git   Package  true        True   [Your repository address]
    57  kpt-samples  git   Package              True   https://github.com/GoogleContainerTools/kpt-samples.git
    58  ```
    59  
    60  ?> Refer to the [get command reference][get-doc] for usage.
    61  
    62  [register-doc]: /reference/cli/alpha/repo/reg/
    63  [get-doc]: /reference/cli/alpha/repo/get/