From ceb4285efaa72b32e38184f642a5035e46b771c9 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Tue, 21 Oct 2025 13:19:02 +0100 Subject: [PATCH 01/14] repository doc example Signed-off-by: lapentafd --- .../setting-up-repositories.md | 186 +++++++++++++++++- 1 file changed, 183 insertions(+), 3 deletions(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index 67924a17..10286553 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -2,9 +2,189 @@ title: "Setting Up Repositories" type: docs weight: 2 -description: +description: "A guide on how to register Git and OCI repositories with Porch using both `porchctl` and `kubectl`." --- -## Lorem Ipsum +# Setting Up Repositories -tutorial in setting up porch repositories and using them +Before Porch can manage packages, you must register the repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages. Porch supports both Git repositories and OCI registries. + +This guide covers the two primary methods for registering a repository with Porch. + +## Table of Contents + +- [Method 1: Using `porchctl`](#method-1-using-porchctl) +- [Method 2: Using `kubectl`](#method-2-using-kubectl) + +## Method 1: Using `porchctl` + +The `porchctl` command-line tool provides a straightforward way to register a repository. + +### Command Syntax + +The basic command for registering a repository is: + +```bash +porchctl repo register REPOSITORY [flags] +``` + +* **`REPOSITORY`**: The URI for the repository. + * For a Git repository, use the standard Git URL (e.g., `http://my-gitea.com/user/repo.git`). + * For an OCI registry, the URI must have the `oci://` prefix (e.g., `oci://us-central1-docker.pkg.dev/my-project/my-repo`). + +### Command Flags + +The following flags can be used to configure the repository registration: + +| Flag | Description | +| ----------------------- | ---------------------------------------------------------------------------------------------------------- | +| `--name` | A unique name for the repository. If not specified, it defaults to the last segment of the repository URL. | +| `--branch` | The branch where finalized packages are committed (Git-only). Defaults to `main`. | +| `--directory` | The directory within the repository where packages are located. Defaults to the repository root (`/`). | +| `--deployment` | If set to `true`, marks the repository as a "deployment" repository, where ready-to-deploy packages reside. | +| `--description` | A human-readable description of the repository. | +| `--repo-basic-username` | The username for basic authentication if the repository is private. | +| `--repo-basic-password` | The password for basic authentication if the repository is private. | + +### Example + +This example registers a private Git repository hosted on Gitea and configures it as a deployment repository. + +```bash +# Register a Git repository with Porch +porchctl repo register http://gitea.gitea:3000/nephio/porch-test.git \ + --name=porch-test \ + --description="Test repository for Porch packages" \ + --branch=main \ + --deployment=true \ + --repo-basic-username=nephio \ + --repo-basic-password=secret +``` + +## Method 2: Using `kubectl` + +Alternatively, you can register a repository by directly applying a `Repository` Custom Resource (CR) to your Kubernetes cluster. This method is ideal for declarative, GitOps-driven workflows. + +### Example + +This example accomplishes the same goal as the `porchctl` command above. It creates a `Secret` for authentication and a `Repository` CR that references it. + +```yaml +# Apply the YAML directly to the cluster +kubectl apply -f - < bmVwaGlv + # password: secret -> c2VjcmV0 + username: bmVwaGlv + password: c2VjcmV0 +--- +# The Repository Custom Resource definition +apiVersion: config.porch.kpt.dev/v1alpha1 +kind: Repository +metadata: + name: porch-test + namespace: porch-demo +spec: + description: "Test repository for Porch packages" + # The type of content stored in the repository + content: Package + # Marks this as a deployment repository + deployment: true + # The repository type (git or oci) + type: git + git: + # The URL of the Git repository + repo: http://gitea.gitea:3000/nephio/porch-test.git + # The directory where packages are stored + directory: / + # The branch for published packages + branch: main + # Whether Porch should create the branch if it doesn't exist + createBranch: true + # Reference to the secret containing authentication credentials + secretRef: + name: gitea +EOF +``` + +### Test Environment Git: Gitea + +To create extra repositories via CLI, in this example we create "blueprints" and "deployment" repositories and we gister them with porch. + +```bash +GIT_USER="nephio" +GIT_PASS="secret" +GIT_HOST="172.18.255.200:30000" # "localhost:3000" for docker-desktop users in WSL +API_URL="http://$GIT_USER:$GIT_PASS@$GIT_HOST/api/v1/user/repos" + +# Define repository names +REPOS=(blueprints deployment) +GIT_ROOT=$(pwd) +# Loop through each repo +for REPO_NAME in "${REPOS[@]}"; do + echo "Creating repo: $REPO_NAME" + + # Create the repository via API + curl -v -k -H "Content-Type: application/json" "$API_URL" --data "{\"name\":\"$REPO_NAME\"}" + + # Create temp directory and clone repo + TMP_DIR=$(mktemp -d) + cd "$TMP_DIR" + git clone "http://$GIT_USER:$GIT_PASS@$GIT_HOST/$GIT_USER/$REPO_NAME.git" + cd "$REPO_NAME" + + # Check if 'main' branch exists + if ! git rev-parse -q --verify refs/remotes/origin/main >/dev/null; then + echo "Add main branch to git repo: $REPO_NAME" + git switch -c main + touch README.md + git add README.md + git config user.name "$GIT_USER" + git commit -m "first commit" + git push -u origin main + else + echo "main branch already exists in git repo: $REPO_NAME" + fi + + # Cleanup + cd "$GIT_ROOT" + rm -rf "$TMP_DIR" + + + kubectl apply -f - < Date: Fri, 24 Oct 2025 11:34:13 +0100 Subject: [PATCH 02/14] Update content/en/docs/neo-porch/4_tutorials_&_how-tos/setting-up-repositories.md Co-authored-by: Fiachra Corcoran --- .../4_tutorials_and_how-tos/setting-up-repositories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index 10286553..bc8f37fa 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -2,7 +2,7 @@ title: "Setting Up Repositories" type: docs weight: 2 -description: "A guide on how to register Git and OCI repositories with Porch using both `porchctl` and `kubectl`." +description: "A how-to guide on registering Git repositories with Porch" --- # Setting Up Repositories From 982687c8fbf8bc98198e405ec1d1aea65c31375f Mon Sep 17 00:00:00 2001 From: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com> Date: Fri, 24 Oct 2025 11:35:04 +0100 Subject: [PATCH 03/14] Update content/en/docs/neo-porch/4_tutorials_&_how-tos/setting-up-repositories.md Co-authored-by: Fiachra Corcoran --- .../4_tutorials_and_how-tos/setting-up-repositories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index bc8f37fa..a19e8a8d 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -1,5 +1,5 @@ --- -title: "Setting Up Repositories" +title: "Managing Porch Repositories" type: docs weight: 2 description: "A how-to guide on registering Git repositories with Porch" From a49ebbc5967b656d727008fa71d8077790596b5a Mon Sep 17 00:00:00 2001 From: lapentafd Date: Tue, 28 Oct 2025 12:57:50 +0000 Subject: [PATCH 04/14] removed OCI reference and referenced porchctl api new docs Signed-off-by: lapentafd --- .../setting-up-repositories.md | 117 ++++-------------- 1 file changed, 23 insertions(+), 94 deletions(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index a19e8a8d..5ef1c017 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -7,16 +7,11 @@ description: "A how-to guide on registering Git repositories with Porch" # Setting Up Repositories -Before Porch can manage packages, you must register the repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages. Porch supports both Git repositories and OCI registries. +Before Porch can manage packages, you must register the repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages. Porch supports both Git repositories and OCI registries (OCI is not fully supported). -This guide covers the two primary methods for registering a repository with Porch. +This guide covers the primary method for registering a repository with Porch. -## Table of Contents - -- [Method 1: Using `porchctl`](#method-1-using-porchctl) -- [Method 2: Using `kubectl`](#method-2-using-kubectl) - -## Method 1: Using `porchctl` +## Using `porchctl` The `porchctl` command-line tool provides a straightforward way to register a repository. @@ -30,7 +25,6 @@ porchctl repo register REPOSITORY [flags] * **`REPOSITORY`**: The URI for the repository. * For a Git repository, use the standard Git URL (e.g., `http://my-gitea.com/user/repo.git`). - * For an OCI registry, the URI must have the `oci://` prefix (e.g., `oci://us-central1-docker.pkg.dev/my-project/my-repo`). ### Command Flags @@ -61,78 +55,19 @@ porchctl repo register http://gitea.gitea:3000/nephio/porch-test.git \ --repo-basic-password=secret ``` -## Method 2: Using `kubectl` - -Alternatively, you can register a repository by directly applying a `Repository` Custom Resource (CR) to your Kubernetes cluster. This method is ideal for declarative, GitOps-driven workflows. - -### Example - -This example accomplishes the same goal as the `porchctl` command above. It creates a `Secret` for authentication and a `Repository` CR that references it. - -```yaml -# Apply the YAML directly to the cluster -kubectl apply -f - < bmVwaGlv - # password: secret -> c2VjcmV0 - username: bmVwaGlv - password: c2VjcmV0 ---- -# The Repository Custom Resource definition -apiVersion: config.porch.kpt.dev/v1alpha1 -kind: Repository -metadata: - name: porch-test - namespace: porch-demo -spec: - description: "Test repository for Porch packages" - # The type of content stored in the repository - content: Package - # Marks this as a deployment repository - deployment: true - # The repository type (git or oci) - type: git - git: - # The URL of the Git repository - repo: http://gitea.gitea:3000/nephio/porch-test.git - # The directory where packages are stored - directory: / - # The branch for published packages - branch: main - # Whether Porch should create the branch if it doesn't exist - createBranch: true - # Reference to the secret containing authentication credentials - secretRef: - name: gitea -EOF -``` ### Test Environment Git: Gitea -To create extra repositories via CLI, in this example we create "blueprints" and "deployment" repositories and we gister them with porch. +To create extra repositories via CLI, in this example we create "blueprints" and "deployment" repositories and we register them with porch. ```bash +# Define repository names to be created +REPOS=(blueprints deployment) +GIT_HOST="172.18.255.200:30000" # "localhost:3000" for docker-desktop users in WSL GIT_USER="nephio" GIT_PASS="secret" -GIT_HOST="172.18.255.200:30000" # "localhost:3000" for docker-desktop users in WSL API_URL="http://$GIT_USER:$GIT_PASS@$GIT_HOST/api/v1/user/repos" - -# Define repository names -REPOS=(blueprints deployment) +NAMESPACE="porch-demo" GIT_ROOT=$(pwd) # Loop through each repo for REPO_NAME in "${REPOS[@]}"; do @@ -165,26 +100,20 @@ for REPO_NAME in "${REPOS[@]}"; do rm -rf "$TMP_DIR" - kubectl apply -f - < Date: Tue, 28 Oct 2025 16:34:57 +0000 Subject: [PATCH 05/14] used relref Signed-off-by: lapentafd --- .../4_tutorials_and_how-tos/setting-up-repositories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index 5ef1c017..87021694 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -116,4 +116,4 @@ done In this example we demonstrate a simple HTTP Basic auth setup using a Kubernetes `Secret`. For production environments, prefer secret management solutions (external secret stores, sealed-secrets, or platform secrets) and avoid embedding plaintext credentials in scripts. -* [Authenticating to Remote Git Repositories](/docs/neo-porch/7_cli_api/porchctl.md) \ No newline at end of file +[Authenticating to Remote Git Repositories]({{% relref "/docs/neo-porch/7_cli_api/porchctl.md" %}}) From af2774441ab7048e6e917b67949708c352c7c712 Mon Sep 17 00:00:00 2001 From: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com> Date: Wed, 29 Oct 2025 11:35:57 +0000 Subject: [PATCH 06/14] Update content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md Co-authored-by: Catalin Stratulat <159934629+Catalin-Stratulat-Ericsson@users.noreply.github.com> --- .../4_tutorials_and_how-tos/setting-up-repositories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index 87021694..047ae0ae 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -116,4 +116,4 @@ done In this example we demonstrate a simple HTTP Basic auth setup using a Kubernetes `Secret`. For production environments, prefer secret management solutions (external secret stores, sealed-secrets, or platform secrets) and avoid embedding plaintext credentials in scripts. -[Authenticating to Remote Git Repositories]({{% relref "/docs/neo-porch/7_cli_api/porchctl.md" %}}) +[Authenticating to Remote Git Repositories]({{% relref "/docs/neo-porch/6_configuration_and_deployments/configurations/private-registries.md" %}}) From 0c04e6a1935a302313db8ac389030971c72dc8b2 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Wed, 29 Oct 2025 14:58:42 +0000 Subject: [PATCH 07/14] removed gitea script and repo flag explaination Signed-off-by: lapentafd --- .../setting-up-repositories.md | 74 +------------------ 1 file changed, 2 insertions(+), 72 deletions(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index 047ae0ae..d430bccb 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -23,22 +23,7 @@ The basic command for registering a repository is: porchctl repo register REPOSITORY [flags] ``` -* **`REPOSITORY`**: The URI for the repository. - * For a Git repository, use the standard Git URL (e.g., `http://my-gitea.com/user/repo.git`). - -### Command Flags - -The following flags can be used to configure the repository registration: - -| Flag | Description | -| ----------------------- | ---------------------------------------------------------------------------------------------------------- | -| `--name` | A unique name for the repository. If not specified, it defaults to the last segment of the repository URL. | -| `--branch` | The branch where finalized packages are committed (Git-only). Defaults to `main`. | -| `--directory` | The directory within the repository where packages are located. Defaults to the repository root (`/`). | -| `--deployment` | If set to `true`, marks the repository as a "deployment" repository, where ready-to-deploy packages reside. | -| `--description` | A human-readable description of the repository. | -| `--repo-basic-username` | The username for basic authentication if the repository is private. | -| `--repo-basic-password` | The password for basic authentication if the repository is private. | +For more information about the `repo` command and available flags, see the porchctl CLI guide [Repository registration]({{% relref "/docs/neo-porch/7_cli_api/relevant_old_docs/porchctl-cli-guide.md#repository-registration" %}}). ### Example @@ -55,62 +40,7 @@ porchctl repo register http://gitea.gitea:3000/nephio/porch-test.git \ --repo-basic-password=secret ``` - -### Test Environment Git: Gitea - -To create extra repositories via CLI, in this example we create "blueprints" and "deployment" repositories and we register them with porch. - -```bash -# Define repository names to be created -REPOS=(blueprints deployment) -GIT_HOST="172.18.255.200:30000" # "localhost:3000" for docker-desktop users in WSL -GIT_USER="nephio" -GIT_PASS="secret" -API_URL="http://$GIT_USER:$GIT_PASS@$GIT_HOST/api/v1/user/repos" -NAMESPACE="porch-demo" -GIT_ROOT=$(pwd) -# Loop through each repo -for REPO_NAME in "${REPOS[@]}"; do - echo "Creating repo: $REPO_NAME" - - # Create the repository via API - curl -v -k -H "Content-Type: application/json" "$API_URL" --data "{\"name\":\"$REPO_NAME\"}" - - # Create temp directory and clone repo - TMP_DIR=$(mktemp -d) - cd "$TMP_DIR" - git clone "http://$GIT_USER:$GIT_PASS@$GIT_HOST/$GIT_USER/$REPO_NAME.git" - cd "$REPO_NAME" - - # Check if 'main' branch exists - if ! git rev-parse -q --verify refs/remotes/origin/main >/dev/null; then - echo "Add main branch to git repo: $REPO_NAME" - git switch -c main - touch README.md - git add README.md - git config user.name "$GIT_USER" - git commit -m "first commit" - git push -u origin main - else - echo "main branch already exists in git repo: $REPO_NAME" - fi - - # Cleanup - cd "$GIT_ROOT" - rm -rf "$TMP_DIR" - - - porchctl repo register http://gitea.gitea:3000/nephio/$REPO_NAME.git \ - --name=$REPO_NAME \ - --namespace=$NAMESPACE \ - --description="$REPO_NAME repository for Porch packages" \ - --branch=main \ - --deployment=true \ - --repo-basic-username=nephio \ - --repo-basic-password=secret - -done -``` +To create additional repositories you can use the Gitea web UI or the Gitea API/CLI. The Porch project includes an example automated setup script that demonstrates creating repositories and initializing branches: [install-dev-gitea-setup.sh](https://github.com/nephio-project/porch/blob/main/scripts/install-dev-gitea-setup.sh#L82). Afterwards, register your new repositories directly with Porch using the `porchctl repo register` command shown above. # See Also From 7b3020ee4212aa184920eee014f9b3b1ac7d54f1 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Wed, 29 Oct 2025 15:39:00 +0000 Subject: [PATCH 08/14] link block script and added explaination for git initialization Signed-off-by: lapentafd --- .../setting-up-repositories.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index d430bccb..4e967065 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -40,7 +40,21 @@ porchctl repo register http://gitea.gitea:3000/nephio/porch-test.git \ --repo-basic-password=secret ``` -To create additional repositories you can use the Gitea web UI or the Gitea API/CLI. The Porch project includes an example automated setup script that demonstrates creating repositories and initializing branches: [install-dev-gitea-setup.sh](https://github.com/nephio-project/porch/blob/main/scripts/install-dev-gitea-setup.sh#L82). Afterwards, register your new repositories directly with Porch using the `porchctl repo register` command shown above. +## Creating Additional Gitea Repositories + +You can create repositories **manually** using the Gitea web UI by following the displayed steps, or you can **automate** their creation using the Gitea API or CLI. The Porch project includes an example automated setup script that demonstrates how to create repositories and initialize branches: + +[install-dev-gitea-setup.sh](https://github.com/nephio-project/porch/blob/23da894a8ef61fea4a4843294f249c3e1817a104/scripts/install-dev-gitea-setup.sh#L82-L100) + +You can customize the `$git_repo_name` variable for the custom repository you wish to create. + +Below is a high-level explanation of the steps performed by that script when initializing a new Gitea repository for use with Porch. + +1. Create the repository via the Gitea REST API +2. Clone the (now-empty) repository locally +3. Ensure a main branch exists and push an initial commit +4. Clean up temporary files +5. Register the new repository with Porch using the command above # See Also From 03c20bf47582641beb338abbeb352e8c7f48ea2b Mon Sep 17 00:00:00 2001 From: lapentafd Date: Wed, 29 Oct 2025 16:06:58 +0000 Subject: [PATCH 09/14] moved sections Signed-off-by: lapentafd --- .../setting-up-repositories.md | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index 4e967065..b6759d31 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -7,9 +7,28 @@ description: "A how-to guide on registering Git repositories with Porch" # Setting Up Repositories -Before Porch can manage packages, you must register the repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages. Porch supports both Git repositories and OCI registries (OCI is not fully supported). +Before Porch can manage packages, you must register the Git repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages. -This guide covers the primary method for registering a repository with Porch. +If you don't have an Git repository already created and initialized then follow the steps below to use Gitea (already provided by the developer environment installation), or create and use your own Git repository. + +## Creating Additional Gitea Repositories (Optional) + +You can create repositories: + +- **manually** using the Gitea web UI by following the displayed steps +- **automate** their creation using the Gitea API/CLI. The Porch project includes an example automated setup script that demonstrates how to create repositories and initialize branches: + +[install-dev-gitea-setup.sh](https://github.com/nephio-project/porch/blob/23da894a8ef61fea4a4843294f249c3e1817a104/scripts/install-dev-gitea-setup.sh#L82-L100) + +You can customize the `$git_repo_name` variable for the custom repository you wish to create. + +Below is a high-level explanation of the steps performed by that script when initializing a new Gitea repository for use with Porch. + +1. Create the repository via the Gitea REST API +2. Clone the (now-empty) repository locally +3. Ensure a main branch exists and push an initial commit +4. Clean up temporary files +5. Register the new repository with Porch using the command below ## Using `porchctl` @@ -40,22 +59,6 @@ porchctl repo register http://gitea.gitea:3000/nephio/porch-test.git \ --repo-basic-password=secret ``` -## Creating Additional Gitea Repositories - -You can create repositories **manually** using the Gitea web UI by following the displayed steps, or you can **automate** their creation using the Gitea API or CLI. The Porch project includes an example automated setup script that demonstrates how to create repositories and initialize branches: - -[install-dev-gitea-setup.sh](https://github.com/nephio-project/porch/blob/23da894a8ef61fea4a4843294f249c3e1817a104/scripts/install-dev-gitea-setup.sh#L82-L100) - -You can customize the `$git_repo_name` variable for the custom repository you wish to create. - -Below is a high-level explanation of the steps performed by that script when initializing a new Gitea repository for use with Porch. - -1. Create the repository via the Gitea REST API -2. Clone the (now-empty) repository locally -3. Ensure a main branch exists and push an initial commit -4. Clean up temporary files -5. Register the new repository with Porch using the command above - # See Also In this example we demonstrate a simple HTTP Basic auth setup using a Kubernetes `Secret`. For production environments, prefer secret management solutions (external secret stores, sealed-secrets, or platform secrets) and avoid embedding plaintext credentials in scripts. From 18c5604308bc15c80070aba7ab93ef584ec7f315 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Fri, 31 Oct 2025 14:16:47 +0000 Subject: [PATCH 10/14] made steps more precise Signed-off-by: lapentafd --- .../4_tutorials_and_how-tos/setting-up-repositories.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index b6759d31..f48b87c5 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -13,22 +13,22 @@ If you don't have an Git repository already created and initialized then follow ## Creating Additional Gitea Repositories (Optional) -You can create repositories: +You can create repositories in two ways: -- **manually** using the Gitea web UI by following the displayed steps -- **automate** their creation using the Gitea API/CLI. The Porch project includes an example automated setup script that demonstrates how to create repositories and initialize branches: +- **Manual — Gitea web UI:** Open your Gitea instance, sign in, and click the **New Repository** (or **+**) button in the top-right of the UI. Follow the form to set the repository name, description, visibility, and initialize the repository. This is the simplest option for one-off repositories. +- **Automated — API / CLI / script:** Automate repository creation via the Gitea REST API, the `gitea` CLI, or an automation script. The Porch project includes an example automated setup script that demonstrates creating repositories and initializing branches: [install-dev-gitea-setup.sh](https://github.com/nephio-project/porch/blob/23da894a8ef61fea4a4843294f249c3e1817a104/scripts/install-dev-gitea-setup.sh#L82-L100) You can customize the `$git_repo_name` variable for the custom repository you wish to create. -Below is a high-level explanation of the steps performed by that script when initializing a new Gitea repository for use with Porch. +Below is a high-level explanation of the steps performed by the automated script when initializing a new Gitea repository for use with Porch. These numbered steps reflect the scripted (API/CLI) approach — you may copy the equivalent commands to run them manually if you prefer. 1. Create the repository via the Gitea REST API 2. Clone the (now-empty) repository locally 3. Ensure a main branch exists and push an initial commit 4. Clean up temporary files -5. Register the new repository with Porch using the command below +5. Register the new repository with Porch using the command shown in the `porchctl` section above ## Using `porchctl` From b40c858b071fbc713330abdcf0e78311be0f682d Mon Sep 17 00:00:00 2001 From: Lapenta Francesco Davide <37077655+lapentad@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:17:19 +0000 Subject: [PATCH 11/14] Update content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md Co-authored-by: Catalin Stratulat <159934629+Catalin-Stratulat-Ericsson@users.noreply.github.com> --- .../4_tutorials_and_how-tos/setting-up-repositories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index f48b87c5..fdb8c61a 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -63,4 +63,4 @@ porchctl repo register http://gitea.gitea:3000/nephio/porch-test.git \ In this example we demonstrate a simple HTTP Basic auth setup using a Kubernetes `Secret`. For production environments, prefer secret management solutions (external secret stores, sealed-secrets, or platform secrets) and avoid embedding plaintext credentials in scripts. -[Authenticating to Remote Git Repositories]({{% relref "/docs/neo-porch/6_configuration_and_deployments/configurations/private-registries.md" %}}) +[Authenticating to Remote Git Repositories]({{% relref "/docs/neo-porch/6_configuration_and_deployments/relevant_old_docs/git-authentication-config.md" %}}) From 2a4a94d9cdd70906e7f5657229eee9b99cddb1ac Mon Sep 17 00:00:00 2001 From: lapentafd Date: Mon, 17 Nov 2025 14:56:09 +0000 Subject: [PATCH 12/14] repository change Signed-off-by: lapentafd --- .../setting-up-repositories.md | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index fdb8c61a..56e5d87c 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -11,26 +11,14 @@ Before Porch can manage packages, you must register the Git repositories where t If you don't have an Git repository already created and initialized then follow the steps below to use Gitea (already provided by the developer environment installation), or create and use your own Git repository. -## Creating Additional Gitea Repositories (Optional) +## Creating and initializing a Git Repository -You can create repositories in two ways: +1. **Create a new repository** in your Git hosting service (e.g., GitHub, GitLab, Gitea, Bitbucket). Navigate to your user or organization page and create a new repository. Provide a name (e.g., `porch-repo`), description, and set visibility as needed. +2. **Initialize the repository** with a README.md file or clone it locally and add initial content. -- **Manual — Gitea web UI:** Open your Gitea instance, sign in, and click the **New Repository** (or **+**) button in the top-right of the UI. Follow the form to set the repository name, description, visibility, and initialize the repository. This is the simplest option for one-off repositories. -- **Automated — API / CLI / script:** Automate repository creation via the Gitea REST API, the `gitea` CLI, or an automation script. The Porch project includes an example automated setup script that demonstrates creating repositories and initializing branches: +For detailed instructions on repository creation, refer to your Git hosting service documentation. [For example on GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories). -[install-dev-gitea-setup.sh](https://github.com/nephio-project/porch/blob/23da894a8ef61fea4a4843294f249c3e1817a104/scripts/install-dev-gitea-setup.sh#L82-L100) - -You can customize the `$git_repo_name` variable for the custom repository you wish to create. - -Below is a high-level explanation of the steps performed by the automated script when initializing a new Gitea repository for use with Porch. These numbered steps reflect the scripted (API/CLI) approach — you may copy the equivalent commands to run them manually if you prefer. - -1. Create the repository via the Gitea REST API -2. Clone the (now-empty) repository locally -3. Ensure a main branch exists and push an initial commit -4. Clean up temporary files -5. Register the new repository with Porch using the command shown in the `porchctl` section above - -## Using `porchctl` +## Register a Git-Repository as a Porch-Repository The `porchctl` command-line tool provides a straightforward way to register a repository. @@ -59,6 +47,10 @@ porchctl repo register http://gitea.gitea:3000/nephio/porch-test.git \ --repo-basic-password=secret ``` +{{% alert title="Note" color="primary" %}} +Replace the Git URL, repository name, username, and password with your values. +{{% /alert %}} + # See Also In this example we demonstrate a simple HTTP Basic auth setup using a Kubernetes `Secret`. For production environments, prefer secret management solutions (external secret stores, sealed-secrets, or platform secrets) and avoid embedding plaintext credentials in scripts. From 6855ca6c58eb42b79330d01d0e7c712af1a8d3ad Mon Sep 17 00:00:00 2001 From: lapentafd Date: Tue, 18 Nov 2025 14:50:23 +0000 Subject: [PATCH 13/14] moved description Signed-off-by: lapentafd --- .../4_tutorials_and_how-tos/setting-up-repositories.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index 56e5d87c..c2e38fb7 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -2,19 +2,15 @@ title: "Managing Porch Repositories" type: docs weight: 2 -description: "A how-to guide on registering Git repositories with Porch" +description: "Tutorial on setting up porch repositories and using them. Before Porch can manage packages, you must register the Git repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages." --- -# Setting Up Repositories - -Before Porch can manage packages, you must register the Git repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages. - -If you don't have an Git repository already created and initialized then follow the steps below to use Gitea (already provided by the developer environment installation), or create and use your own Git repository. +If you don't have a Git repository already created and initialized, follow the steps below to create and use your own Git repository. ## Creating and initializing a Git Repository 1. **Create a new repository** in your Git hosting service (e.g., GitHub, GitLab, Gitea, Bitbucket). Navigate to your user or organization page and create a new repository. Provide a name (e.g., `porch-repo`), description, and set visibility as needed. -2. **Initialize the repository** with a README.md file or clone it locally and add initial content. +2. **Initialize the repository** for the main/master branch to exist (typically done by adding a README.md file in the UI) or by cloning it locally and add initial content. For detailed instructions on repository creation, refer to your Git hosting service documentation. [For example on GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories). From 67481cc9592cc60360d7c0fa176471a1eb3eb058 Mon Sep 17 00:00:00 2001 From: lapentafd Date: Thu, 20 Nov 2025 11:05:48 +0000 Subject: [PATCH 14/14] style suggestions Signed-off-by: lapentafd --- .../setting-up-repositories.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md index c2e38fb7..d0131412 100644 --- a/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md +++ b/content/en/docs/neo-porch/4_tutorials_and_how-tos/setting-up-repositories.md @@ -1,16 +1,18 @@ --- -title: "Managing Porch Repositories" +title: Managing Porch Repositories type: docs weight: 2 -description: "Tutorial on setting up porch repositories and using them. Before Porch can manage packages, you must register the Git repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages." +description: Tutorial on setting up Porch repositories and using them. Before Porch can manage packages, you must register the Git repositories where those packages are stored. This tells Porch where to find package blueprints and where to store deployment packages. --- If you don't have a Git repository already created and initialized, follow the steps below to create and use your own Git repository. ## Creating and initializing a Git Repository -1. **Create a new repository** in your Git hosting service (e.g., GitHub, GitLab, Gitea, Bitbucket). Navigate to your user or organization page and create a new repository. Provide a name (e.g., `porch-repo`), description, and set visibility as needed. -2. **Initialize the repository** for the main/master branch to exist (typically done by adding a README.md file in the UI) or by cloning it locally and add initial content. +1. **Create a new repository** in your Git hosting service (e.g., GitHub, GitLab, Gitea, Bitbucket). + - Navigate to your user or organization page and create a new repository. + - Provide a name (e.g., `porch-repo`), description, and set visibility as needed. +2. **Initialize the repository** for the main/master branch to exist (typically done by adding a *README.md* file in the UI) or by cloning it locally and adding initial content. For detailed instructions on repository creation, refer to your Git hosting service documentation. [For example on GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories). @@ -26,7 +28,7 @@ The basic command for registering a repository is: porchctl repo register REPOSITORY [flags] ``` -For more information about the `repo` command and available flags, see the porchctl CLI guide [Repository registration]({{% relref "/docs/neo-porch/7_cli_api/relevant_old_docs/porchctl-cli-guide.md#repository-registration" %}}). +For more information about the `repo` command and available flags, see the Porchctl CLI guide [Repository registration]({{% relref "/docs/neo-porch/7_cli_api/relevant_old_docs/porchctl-cli-guide.md#repository-registration" %}}). ### Example @@ -44,11 +46,11 @@ porchctl repo register http://gitea.gitea:3000/nephio/porch-test.git \ ``` {{% alert title="Note" color="primary" %}} -Replace the Git URL, repository name, username, and password with your values. +Replace the Git URL, repository name, username, and password with your own values. {{% /alert %}} # See Also -In this example we demonstrate a simple HTTP Basic auth setup using a Kubernetes `Secret`. For production environments, prefer secret management solutions (external secret stores, sealed-secrets, or platform secrets) and avoid embedding plaintext credentials in scripts. +In this example we demonstrate a simple HTTP Basic auth setup using a Kubernetes `Secret`. For production environments, secret management solutions are preferred (external secret stores, sealed-secrets, or platform secrets) and the avoidance of embedding plaintext credentials in scripts. [Authenticating to Remote Git Repositories]({{% relref "/docs/neo-porch/6_configuration_and_deployments/relevant_old_docs/git-authentication-config.md" %}})