diff --git a/docs/assets/use-cases/tekton-custom/argocd-sync.png b/docs/assets/use-cases/tekton-custom/argocd-sync.png new file mode 100644 index 0000000000..e6129fcc4f Binary files /dev/null and b/docs/assets/use-cases/tekton-custom/argocd-sync.png differ diff --git a/docs/assets/use-cases/tekton-custom/cluster-settings.png b/docs/assets/use-cases/tekton-custom/cluster-settings.png deleted file mode 100644 index ed96affe35..0000000000 Binary files a/docs/assets/use-cases/tekton-custom/cluster-settings.png and /dev/null differ diff --git a/docs/assets/use-cases/tekton-custom/components.png b/docs/assets/use-cases/tekton-custom/components.png deleted file mode 100644 index f2ac9326f9..0000000000 Binary files a/docs/assets/use-cases/tekton-custom/components.png and /dev/null differ diff --git a/docs/assets/use-cases/tekton-custom/open-krci-pipelines.png b/docs/assets/use-cases/tekton-custom/open-krci-pipelines.png new file mode 100644 index 0000000000..5036ddb890 Binary files /dev/null and b/docs/assets/use-cases/tekton-custom/open-krci-pipelines.png differ diff --git a/docs/assets/use-cases/tekton-custom/ready-component.png b/docs/assets/use-cases/tekton-custom/ready-component.png new file mode 100644 index 0000000000..688dadf8b9 Binary files /dev/null and b/docs/assets/use-cases/tekton-custom/ready-component.png differ diff --git a/docs/assets/use-cases/tekton-custom/review-and-create.png b/docs/assets/use-cases/tekton-custom/review-and-create.png new file mode 100644 index 0000000000..9e6b625833 Binary files /dev/null and b/docs/assets/use-cases/tekton-custom/review-and-create.png differ diff --git a/docs/assets/use-cases/tekton-custom/select-pipeline.png b/docs/assets/use-cases/tekton-custom/select-pipeline.png new file mode 100644 index 0000000000..d115b54908 Binary files /dev/null and b/docs/assets/use-cases/tekton-custom/select-pipeline.png differ diff --git a/docs/assets/use-cases/tekton-custom/synced-pipelines.png b/docs/assets/use-cases/tekton-custom/synced-pipelines.png new file mode 100644 index 0000000000..8bd3bb42c1 Binary files /dev/null and b/docs/assets/use-cases/tekton-custom/synced-pipelines.png differ diff --git a/docs/assets/use-cases/tekton-custom/synchronize-resource.png b/docs/assets/use-cases/tekton-custom/synchronize-resource.png new file mode 100644 index 0000000000..e1a8902b70 Binary files /dev/null and b/docs/assets/use-cases/tekton-custom/synchronize-resource.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom01.png b/docs/assets/use-cases/tekton-custom/tekton-custom01.png deleted file mode 100644 index 30f52cce60..0000000000 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom01.png and /dev/null differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom02.png b/docs/assets/use-cases/tekton-custom/tekton-custom02.png index 82d2dcfb80..37df23ce65 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom02.png and b/docs/assets/use-cases/tekton-custom/tekton-custom02.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom03.png b/docs/assets/use-cases/tekton-custom/tekton-custom03.png index c23e4819d0..e721715c61 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom03.png and b/docs/assets/use-cases/tekton-custom/tekton-custom03.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom04.png b/docs/assets/use-cases/tekton-custom/tekton-custom04.png index 19c5883249..a22fc75fc7 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom04.png and b/docs/assets/use-cases/tekton-custom/tekton-custom04.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom05.png b/docs/assets/use-cases/tekton-custom/tekton-custom05.png index 1bf74d58ea..a2f27ff13e 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom05.png and b/docs/assets/use-cases/tekton-custom/tekton-custom05.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom06.png b/docs/assets/use-cases/tekton-custom/tekton-custom06.png index 838837b431..07b00785bd 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom06.png and b/docs/assets/use-cases/tekton-custom/tekton-custom06.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom07.png b/docs/assets/use-cases/tekton-custom/tekton-custom07.png index 97f17b7797..7216998f39 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom07.png and b/docs/assets/use-cases/tekton-custom/tekton-custom07.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom08.png b/docs/assets/use-cases/tekton-custom/tekton-custom08.png index e3e98774fc..7f2dd38713 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom08.png and b/docs/assets/use-cases/tekton-custom/tekton-custom08.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom09.png b/docs/assets/use-cases/tekton-custom/tekton-custom09.png index d4f7fea162..48ab3e3576 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom09.png and b/docs/assets/use-cases/tekton-custom/tekton-custom09.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom10.png b/docs/assets/use-cases/tekton-custom/tekton-custom10.png index 40fc152483..724805919f 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom10.png and b/docs/assets/use-cases/tekton-custom/tekton-custom10.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom11.png b/docs/assets/use-cases/tekton-custom/tekton-custom11.png index b7ee551e29..dc7397dd32 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom11.png and b/docs/assets/use-cases/tekton-custom/tekton-custom11.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom12.png b/docs/assets/use-cases/tekton-custom/tekton-custom12.png index cdee556889..2ecf33bf0a 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom12.png and b/docs/assets/use-cases/tekton-custom/tekton-custom12.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom13.png b/docs/assets/use-cases/tekton-custom/tekton-custom13.png index 76fea3644c..3b035d46ad 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom13.png and b/docs/assets/use-cases/tekton-custom/tekton-custom13.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom14.png b/docs/assets/use-cases/tekton-custom/tekton-custom14.png index 28d2889db1..184eb8f4b1 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom14.png and b/docs/assets/use-cases/tekton-custom/tekton-custom14.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom15.png b/docs/assets/use-cases/tekton-custom/tekton-custom15.png index 5ba5ad7b91..85aee44855 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom15.png and b/docs/assets/use-cases/tekton-custom/tekton-custom15.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom16.png b/docs/assets/use-cases/tekton-custom/tekton-custom16.png index 915d4177b9..4c39ab4520 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom16.png and b/docs/assets/use-cases/tekton-custom/tekton-custom16.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom17.png b/docs/assets/use-cases/tekton-custom/tekton-custom17.png index ca89c2d5a5..b925c229e5 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom17.png and b/docs/assets/use-cases/tekton-custom/tekton-custom17.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom178.png b/docs/assets/use-cases/tekton-custom/tekton-custom178.png deleted file mode 100644 index 064be357fc..0000000000 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom178.png and /dev/null differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom18.png b/docs/assets/use-cases/tekton-custom/tekton-custom18.png index 2443f9e914..0f86268494 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom18.png and b/docs/assets/use-cases/tekton-custom/tekton-custom18.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom19.png b/docs/assets/use-cases/tekton-custom/tekton-custom19.png index 391d3313fc..e21726de9a 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom19.png and b/docs/assets/use-cases/tekton-custom/tekton-custom19.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom20.png b/docs/assets/use-cases/tekton-custom/tekton-custom20.png deleted file mode 100644 index 2540281ada..0000000000 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom20.png and /dev/null differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom21.png b/docs/assets/use-cases/tekton-custom/tekton-custom21.png index 2cd2ce0a1c..1c17684c03 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom21.png and b/docs/assets/use-cases/tekton-custom/tekton-custom21.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom22.png b/docs/assets/use-cases/tekton-custom/tekton-custom22.png index 4bd5d03551..75dc1bdf6a 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom22.png and b/docs/assets/use-cases/tekton-custom/tekton-custom22.png differ diff --git a/docs/assets/use-cases/tekton-custom/tekton-custom23.png b/docs/assets/use-cases/tekton-custom/tekton-custom23.png index 72c431f40a..04e85114f5 100644 Binary files a/docs/assets/use-cases/tekton-custom/tekton-custom23.png and b/docs/assets/use-cases/tekton-custom/tekton-custom23.png differ diff --git a/docs/use-cases/tekton-custom-pipelines.md b/docs/use-cases/tekton-custom-pipelines.md index b2e382be59..2ccf22fb92 100644 --- a/docs/use-cases/tekton-custom-pipelines.md +++ b/docs/use-cases/tekton-custom-pipelines.md @@ -14,28 +14,32 @@ sidebar_label: "Deploy Application With Custom Build Tool/Framework" This use case demonstrates how to implement custom CI/CD pipelines within the KubeRocketCI platform to address project-specific requirements. -KubeRocketCI extends this capability by supporting the **customization** of Applications (Components) and Tekton pipelines, allowing teams to integrate and develop functionalities or services not readily available on the platform. +KubeRocketCI extends this capability by supporting the **customization** of Applications (Projects) and Tekton pipelines, allowing teams to integrate and develop functionalities or services not readily available on the platform. ## Goals +The goal of this is to configure KubeRocketCI in a way to: + - Incorporate and manage custom Tekton pipeline libraries that addresses project requirements. - Modify existing pipelines and tasks within these libraries to align with specific developmental goals and introduce novel functionalities. - Facilitate a swift setup and implementation process, enabling teams to focus on development without being hindered by platform limitations. ## Preconditions +Before starting this use case, ensure that: + - KubeRocketCI instance with GitHub and Tekton is [configured](../operator-guide/prerequisites.md); - Developer has access to the KubeRocketCI instances using the Single-Sign-On approach; - Developer has `Write` permissions for GitHub repository to merge the code; -- Configured Argo CD instance with the [Add-ons repository](../operator-guide/add-ons-overview.md) added. +- Argo CD instance is configured with the [Add-ons repository](../operator-guide/add-ons-overview.md) added. ## Scenario To streamline the process of implementing custom logic within the KubeRocketCI platform, follow this scenario: -- Add Custom Application: Begin by adding your application to the KubeRocketCI platform. -- Add Custom Tekton Library: Create and add a custom Tekton library designed to implement the CI/CD logic required by your application. -- Validate the Implementation: After setting up your Application and Tekton library, conduct testing to ensure that the pipelines execute as intended. +- **Add Custom Application**: Begin by adding your application to the KubeRocketCI platform. +- **Add Custom Tekton Library**: Create and add a custom Tekton library designed to implement the CI/CD logic required by your application. +- **Validate the Implementation**: After setting up your Application and Tekton library, conduct testing to ensure that the pipelines execute as intended. ### Add Custom Application to KubeRocketCI @@ -44,49 +48,63 @@ To streamline the process of implementing custom logic within the KubeRocketCI p This encompasses scenarios where the default pipeline configurations and toolchains are unable to meet the unique requirements of the application, thereby requiring the development and integration of tailored solutions. ::: -1. Open the KubeRocketCI portal. Use the **Sign-In** option: +1. Log in to the KubeRocketCI portal: + + ![Logging Page](../assets/use-cases/general/login-1.png "Logging screen") - ![Logging Page](../assets/use-cases/general/login.png "Logging Screen") +2. On the main menu, click the **Manage Namespaces** button: -2. In the top right corner, enter the `Account settings` and ensure that both `Default namespace` and `Allowed namespace` are set: + ![Manage Namespaces](../assets/use-cases/general/settings-1.png "Manage Namespaces button") - ![Settings](../assets/use-cases/tekton-custom/cluster-settings.png "Cluster Settings") +3. Ensure the `Namespace` value points to the namespace with the KubeRocketCI installation: -3. Select the **Components** tab and push the create **+ CREATE COMPONENT** button: + ![Default and allowed namespaces](../assets/use-cases/fastapi-scaffolding/default-allowed-namespace.png "Default and allowed namespaces") - ![Components Overview](../assets/use-cases/tekton-custom/components.png "Components Overview") + :::note + Don't forget to press Enter to add the namespace to the allowed namespaces list. + ::: -4. Choose the `Application` type since it is intended for containerization and deployment within a Kubernetes cluster. Click the **Next** button. +4. Select the **Projects** section and click **+ Create project**: - ![Create Application Menu](../assets/use-cases/tekton-custom/tekton-custom01.png "Create Application Menu") + ![Projects tab](../assets/use-cases/general/components-1.png "Projects tab") -5. Choose the `Clone` strategy, since we are cloning the application from the existing repository: +5. Create a new Project of the `Application` type using the `Clone` strategy since we are cloning the application from the existing repository: ![Clone Project](../assets/use-cases/tekton-custom/tekton-custom02.png "Clone Project") -6. In the **Add component info** tab, define the following values and click the **Proceed** button: +6. In the **Git & project info** tab, define the following values and click the **Continue** button: - - Git Server: select the available GitHub server - Repository URL: `https://github.com/epmd-edp/go-go-beego.git` + - Git Server: select the available GitHub server + - Owner: `github_account_name` - Repository name: `tekton-hello-world` - - Component name: `tekton-hello-world` + - Project name: `tekton-hello-world` + - Default branch: `main` - Description: `Custom tekton-hello-world application` + + ![Git & project info](../assets/use-cases/tekton-custom/tekton-custom03.png "Git & project info") + +7. In the **Build config** tab, define the values and click the **Continue** button: + + - Deployment option: `helm-chart` - Application code language: `Other` - Language version/framework: `go` - Build tool: `shell` + - Codebase versioning type: `semver` + - Start version from: `0.1.0` + - Suffix: `SNAPSHOT` - ![Application Menu](../assets/use-cases/tekton-custom/tekton-custom03.png "Application Menu") + ![Build config](../assets/use-cases/tekton-custom/tekton-custom04.png "Build config") -7. In the **Advanced Settings** tab, define the below values and click the **Create** button: +8. On the **Review** tab, verify the project configuration and click **Create project**: - - Default branch: `main` - - Deployment option: `helm-chart` - - Codebase versioning type: `semver` - - Leave `Specify the pattern to validate a commit message` empty. + ![Review and create](../assets/use-cases/tekton-custom/review-and-create.png "Review and create") + +9. On the congratulations page, click **View all projects**: - ![Application Menu](../assets/use-cases/tekton-custom/tekton-custom04.png "Application Menu") + ![Ready project](../assets/use-cases/tekton-custom/ready-component.png "Ready project") -8. Check the application status. It should be green. +10. Check the application status. It should be green: Now that the application is successfully created, proceed to adding the Tekton library to the KubeRocketCI platform. @@ -100,54 +118,64 @@ To streamline the process of implementing custom logic within the KubeRocketCI p name: github-$(tt.params.buildtool)-$(tt.params.framework)-$(tt.params.cbtype)-build-$(tt.params.versioning-type) ``` - This naming convention facilitates the automatic creation of PipelineRun instances in response to payload from GitHub during Merge Request events. + ```yaml + pipelineRef: + name: github-$(tt.params.buildtool)-$(tt.params.framework)-$(tt.params.cbtype)-review + ``` + + This naming convention facilitates the automatic creation of PipelineRun instances in response to payload from GitHub: the review pipeline runs during Merge Request events, and the build pipeline runs after the changes are merged. Ensure that the Pipeline name matches this structure to enable the correct triggering of pipeline executions. - In our case, the build pipeline name should be `github-shell-go-app-build-edp` + In our case, the build pipeline name should be `github-shell-go-app-build-semver` and the review pipeline name should be `github-shell-go-app-review`. ::: ### Add Tekton Library KubeRocketCI allows for the creation of custom Tekton libraries to address specific project requirements. This feature enables the modification of existing pipelines and tasks to align with the unique needs of the application. -1. Select the **Components** tab and push the create **+ CREATE COMPONENT** button: +1. Select the **Projects** tab and push the create **+ Create Project** button: - ![Components Overview](../assets/use-cases/tekton-custom/tekton-custom05.png "Components tab") + ![Projects tab](../assets/use-cases/tekton-custom/tekton-custom05.png "Projects tab") -2. Create a new Codebase with the `Library` type: +2. Select **Custom configuration**, **Library**, **Create** and click **Continue**: ![Create Library](../assets/use-cases/tekton-custom/tekton-custom06.png "Create Library") - -3. Select **Create from template** and click **Create** button: - - ![Create From Template](../assets/use-cases/tekton-custom/tekton-custom07.png "Create From Template") - + :::note The KubeRocketCI `Create` strategy will automatically pull the code for the Tekton Helm application from [the template](https://github.com/epmd-edp/helm-helm-pipeline.git). ::: -4. In the Application Info tab, define the following values and click the `Proceed` button: +3. In the **Git & project info** tab, define the following values and click the **Continue** button: + - Git Server: select the available GitHub server + - Owner: `github_account_name` - Repository name: `custom-tekton-chart` - - Component name: `custom-tekton-chart` + - Project name: `custom-tekton-chart` - Description: `Repository for storing and managing custom Tekton resources` + + ![Create From Template](../assets/use-cases/tekton-custom/tekton-custom07.png "Create From Template") + +4. In the **Build config** tab, define the values and click the **Continue** button: + - Application code language: `Helm` - Language version/framework: `Pipeline` - Build tool: `Helm` + - Default branch: `main` + - Codebase versioning type: `semver` + - Start version from: `0.1.0` + - Suffix: `SNAPSHOT` ![Codebase Info](../assets/use-cases/tekton-custom/tekton-custom08.png "Step codebase info") -5. In the `Advanced Settings` tab, define the below values and click the `Apply` button: - - - Default branch: `main` - - Codebase versioning type: `semver` - - Leave `Specify the pattern to validate a commit message` empty. +5. On the **Review** tab, verify the project configuration and click **Create project**: ![Advanced Settings](../assets/use-cases/tekton-custom/tekton-custom09.png "Advanced settings") -6. Check the codebases status: +6. On the congratulations page, click **View all projects**. - ![Components overview page](../assets/use-cases/tekton-custom/tekton-custom10.png "Codebase status") +7. Check the codebases' status: + + ![Projects overview page](../assets/use-cases/tekton-custom/tekton-custom10.png "Projects overview page") You have successfully added the custom Tekton library to the KubeRocketCI platform and are now ready to modify the Tekton pipeline to align with the specific requirements of your custom application. @@ -159,9 +187,9 @@ You have successfully added the custom Tekton library to the KubeRocketCI platfo Now that the Tekton Helm library is created, it is time to clone, modify and then apply it to the Kubernetes cluster. -1. In the Components tab, click one of the `custom-tekton-chart` to enter the application menu: +1. In the Projects tab, click one of the `custom-tekton-chart` to enter the application menu: - ![Components overview page](../assets/use-cases/tekton-custom/tekton-custom11.png "Codebase status") + ![Select overview page](../assets/use-cases/tekton-custom/tekton-custom11.png "Codebase status") 2. Navigate to **Branches** and click to the **Git** button: @@ -182,24 +210,24 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the │   │   │   ├── custom-clean.yaml │   │   │   └── custom-deploy.yaml │   │   ├── bitbucket-build-default.yaml - │   │   ├── bitbucket-build-edp.yaml + │   │   ├── bitbucket-build-semver.yaml │   │   ├── bitbucket-build-lib-default.yaml - │   │   ├── bitbucket-build-lib-edp.yaml + │   │   ├── bitbucket-build-lib-semver.yaml │   │   ├── bitbucket-review.yaml │   │   ├── gerrit-build-default.yaml - │   │   ├── gerrit-build-edp.yaml + │   │   ├── gerrit-build-semver.yaml │   │   ├── gerrit-build-lib-default.yaml - │   │   ├── gerrit-build-lib-edp.yaml + │   │   ├── gerrit-build-lib-semver.yaml │   │   ├── gerrit-review.yaml │   │   ├── github-build-default.yaml - │   │   ├── github-build-edp.yaml + │   │   ├── github-build-semver.yaml │   │   ├── github-build-lib-default.yaml - │   │   ├── github-build-lib-edp.yaml + │   │   ├── github-build-lib-semver.yaml │   │   ├── github-review.yaml │   │   ├── gitlab-build-default.yaml - │   │   ├── gitlab-build-edp.yaml + │   │   ├── gitlab-build-semver.yaml │   │   ├── gitlab-build-lib-default.yaml - │   │   ├── gitlab-build-lib-edp.yaml + │   │   ├── gitlab-build-lib-semver.yaml │   │   └── gitlab-review.yaml │   ├── resources │   │   └── npm-settings.yaml @@ -230,10 +258,10 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the 5. Modify and add tasks or pipelines. Consider the scenario where it's necessary to incorporate the `helm-lint` task into the review pipeline. - To achieve this, append the following code snippet to the `templates/pipelines/github-review.yaml` file, specifically below the `hello-world` task, located here: [github-review.yaml](https://github.com/epmd-edp/helm-helm-pipeline/blob/master/templates/pipelines/github-review.yaml#L114): + To achieve this, set the `metadata.name` field to `github-shell-go-app-review` and append the following code snippet to the `templates/pipelines/github-review.yaml` file, specifically below the `hello-world` task, located here: [github-review.yaml](https://github.com/epmd-edp/helm-helm-pipeline/blob/master/templates/pipelines/github-review.yaml#L114): ```yaml - apiVersion: tekton.dev/v1beta1 + apiVersion: tekton.dev/v1 kind: Pipeline metadata: name: github-shell-go-app-review @@ -275,13 +303,13 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the The `runAfter` parameter indicates the execution sequence, specifying that the `helm-lint` task is scheduled to run subsequent to the completion of the `hello-world` task. ::: - Also, in the `templates/pipelines/github-build-edp.yaml` file, specify the name `github-shell-go-app-build-edp` for the custom build pipeline: + Also, in the `templates/pipelines/github-build-semver.yaml` file, specify the name `github-shell-go-app-build-semver` for the custom build pipeline: ```yaml - apiVersion: tekton.dev/v1beta1 + apiVersion: tekton.dev/v1 kind: Pipeline metadata: - name: github-shell-go-app-build-edp + name: github-shell-go-app-build-semver ... ``` @@ -298,7 +326,7 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the ![Create pull request](../assets/use-cases/tekton-custom/tekton-custom15.png "Create pull request") -8. Check the GitHub code review for the custom Helm chart pipelines repository in KubeRocketCI. Navigate **Components** -> **Component name** and click to the review pipeline run: +8. Check the GitHub code review for the custom Helm chart pipelines repository in KubeRocketCI. Navigate to **Projects** -> **Project name** and click to the review pipeline run: ![KubeRocketCI pipelines overview](../assets/use-cases/tekton-custom/tekton-custom14.png "KubeRocketCI pipelines overview") @@ -306,7 +334,7 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the ![Explore pipeline](../assets/use-cases/tekton-custom/tekton-custom16.png "Explore pipeline") -10. Go to the GitHub **Pull requests** -> **Add Helm chart testing for go-shell application** -> and click **Merge pull request**: +10. Go to the GitHub **Pull requests** -> **Add Helm chart testing for go-shell application** and click **Merge pull request**: ![Merge PR](../assets/use-cases/tekton-custom/tekton-custom17.png "Merge PR") @@ -316,13 +344,13 @@ To deploy custom pipelines to the cluster, you can use Argo CD, which includes a To deliver custom Tekton pipelines to the cluster, follow these steps: -1. Clone the forked repository with add-ons and make the following changes. In the `clusters/core/apps/values.yaml` file, set the `repoUrl` and `namespace` fields to specify the Git URL of the `tekton-custom-pipelines` repository and the namespace where the KubeRocketCI platform is deployed. Also, set the `kuberocketci-pipelines.enabled` field to `true` to enable the deployment of the `tekton-custom-pipelines` Argo CD Application: +1. Clone the forked repository with add-ons and make the following changes. In the `clusters/core/apps/values.yaml` file, set the `repoUrl` and `namespace` fields to specify the Git URL of the `custom-tekton-chart` repository and the namespace where the KubeRocketCI platform is deployed. Also, set the `kuberocketci-pipelines.enable` field to `true` to enable the deployment of the `kuberocketci-pipelines` Argo CD Application: ```yaml kuberocketci-pipelines: enable: true namespace: - repoUrl: ssh://git@github.com:22//tekton-custom-pipelines.git + repoUrl: ssh://git@github.com:22//custom-tekton-chart.git ``` 2. Commit and push the changes to the repository. @@ -335,9 +363,25 @@ To deliver custom Tekton pipelines to the cluster, follow these steps: git push origin main ``` -3. After pushing the changes, access **Argo CD**, navigate to the Application that corresponds to the repository with the **add-ons**, and initiate the `Sync` process. This will apply the `tekton-custom-pipelines` Helm Chart to the cluster within the specified namespace. +3. After pushing the changes, access **Argo CD**, navigate to the Application that corresponds to the repository with the **add-ons**, and initiate the `Sync` process. This will apply the `custom-tekton-chart` Helm Chart to the cluster within the specified namespace: + + ![Argo CD Sync](../assets/use-cases/tekton-custom/argocd-sync.png "Argo CD Sync") + +4. Open the **kuberocketci-pipelines** component by clicking the link button: + + ![KubeRocketCI pipelines component](../assets/use-cases/tekton-custom/open-krci-pipelines.png "KubeRocketCI pipelines component") + +5. Find the **github-shell-go-app-build-semver** pipeline and select **Details**: + + ![Select pipeline](../assets/use-cases/tekton-custom/select-pipeline.png "Select pipeline") - ![Argo CD Sync](../assets/use-cases/custom-tekton-pipelines/argocd-sync.png "Argo CD Sync") +6. On the resource window, click **Sync** -> **Synchronize**: + + ![Synchronize resource](../assets/use-cases/tekton-custom/synchronize-resource.png "Synchronize resource") + +7. Repeat the steps 5-6 for the **github-shell-go-app-review** pipeline: + + ![Synced pipelines](../assets/use-cases/tekton-custom/synced-pipelines.png "Synced pipelines") ### Create Application Merge Request @@ -345,30 +389,27 @@ Since we applied the Tekton library to the Kubernetes cluster in the previous st Perform the below steps to merge new code (Merge Request) that passes the Code Review flow. For the steps below, we use GitHub UI but the same actions can be performed using the command line and Git tool: -1. In the Components tab, click one of the `custom-tekton-chart` to enter the application menu. +1. In the Projects tab, click on the `tekton-hello-world` name to enter the application details page. -2. Navigate to **Branches** and click to the **Git** button: +2. Navigate to **Branches** and click to the branch name button: - ![Component's branch tab](../assets/use-cases/tekton-custom/tekton-custom18.png "Component's branch tab") + ![Project's branch tab](../assets/use-cases/tekton-custom/tekton-custom18.png "Project's branch tab") -3. Navigate to the **Branches** menu, create new branch from **New branch** menu with name `test`, and the click on the test branch: +3. Navigate to the **Branches** menu, create a new branch from the **New branch** menu with name `test`, and click on the test branch: ![Create Branch](../assets/use-cases/tekton-custom/tekton-custom19.png "Create Branch") -4. Change file `deploy-templates/values.yaml` with values below: +4. Change file `deploy-templates/values.yaml` by changing the `replicaCount` value: ```yaml ... - ingress: - enabled: true + replicaCount: 2 ... ``` - ![Create Merge Request](../assets/use-cases/tekton-custom/tekton-custom20.png "Create Merge Request") - -5. Navigate to the **Pull requests** -> **Compare & pull request** -> and click **Create pull request**: +5. Click **Pull requests** -> **Compare & pull request** -> and click **Create pull request**. -6. Check the Review Pipeline status. Navigate KubeRocketCI -> **Components** -> `tekton-hello-world` and click on review pipeline. The `helm-lint` task should be displayed there: +6. Check the Review Pipeline status. Navigate KubeRocketCI -> **Projects** -> `tekton-hello-world` and click on review pipeline. The `helm-lint` task should be displayed there: ![Explore Lint Step](../assets/use-cases/tekton-custom/tekton-custom21.png "Explore Lint Step") diff --git a/versioned_docs/version-3.11/assets/use-cases/tekton-custom/tekton-custom11.png b/versioned_docs/version-3.11/assets/use-cases/tekton-custom/tekton-custom11.png index b7ee551e29..f72a3682f3 100644 Binary files a/versioned_docs/version-3.11/assets/use-cases/tekton-custom/tekton-custom11.png and b/versioned_docs/version-3.11/assets/use-cases/tekton-custom/tekton-custom11.png differ diff --git a/versioned_docs/version-3.11/assets/use-cases/tekton-custom/tekton-custom16.png b/versioned_docs/version-3.11/assets/use-cases/tekton-custom/tekton-custom16.png index 915d4177b9..c9ce671399 100644 Binary files a/versioned_docs/version-3.11/assets/use-cases/tekton-custom/tekton-custom16.png and b/versioned_docs/version-3.11/assets/use-cases/tekton-custom/tekton-custom16.png differ diff --git a/versioned_docs/version-3.12/assets/use-cases/tekton-custom/tekton-custom11.png b/versioned_docs/version-3.12/assets/use-cases/tekton-custom/tekton-custom11.png index b7ee551e29..098fa6d8db 100644 Binary files a/versioned_docs/version-3.12/assets/use-cases/tekton-custom/tekton-custom11.png and b/versioned_docs/version-3.12/assets/use-cases/tekton-custom/tekton-custom11.png differ diff --git a/versioned_docs/version-3.12/assets/use-cases/tekton-custom/tekton-custom16.png b/versioned_docs/version-3.12/assets/use-cases/tekton-custom/tekton-custom16.png index 915d4177b9..ef88265969 100644 Binary files a/versioned_docs/version-3.12/assets/use-cases/tekton-custom/tekton-custom16.png and b/versioned_docs/version-3.12/assets/use-cases/tekton-custom/tekton-custom16.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/argocd-sync.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/argocd-sync.png new file mode 100644 index 0000000000..e6129fcc4f Binary files /dev/null and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/argocd-sync.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/cluster-settings.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/cluster-settings.png deleted file mode 100644 index ed96affe35..0000000000 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/cluster-settings.png and /dev/null differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/components.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/components.png deleted file mode 100644 index f2ac9326f9..0000000000 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/components.png and /dev/null differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/open-krci-pipelines.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/open-krci-pipelines.png new file mode 100644 index 0000000000..5036ddb890 Binary files /dev/null and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/open-krci-pipelines.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/ready-component.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/ready-component.png new file mode 100644 index 0000000000..688dadf8b9 Binary files /dev/null and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/ready-component.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/review-and-create.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/review-and-create.png new file mode 100644 index 0000000000..9e6b625833 Binary files /dev/null and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/review-and-create.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/select-pipeline.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/select-pipeline.png new file mode 100644 index 0000000000..d115b54908 Binary files /dev/null and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/select-pipeline.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/synced-pipelines.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/synced-pipelines.png new file mode 100644 index 0000000000..8bd3bb42c1 Binary files /dev/null and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/synced-pipelines.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/synchronize-resource.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/synchronize-resource.png new file mode 100644 index 0000000000..e1a8902b70 Binary files /dev/null and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/synchronize-resource.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom01.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom01.png deleted file mode 100644 index 30f52cce60..0000000000 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom01.png and /dev/null differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom02.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom02.png index 82d2dcfb80..37df23ce65 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom02.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom02.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom03.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom03.png index c23e4819d0..e721715c61 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom03.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom03.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom04.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom04.png index 19c5883249..a22fc75fc7 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom04.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom04.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom05.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom05.png index 1bf74d58ea..a2f27ff13e 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom05.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom05.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom06.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom06.png index 838837b431..07b00785bd 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom06.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom06.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom07.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom07.png index 97f17b7797..7216998f39 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom07.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom07.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom08.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom08.png index e3e98774fc..7f2dd38713 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom08.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom08.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom09.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom09.png index d4f7fea162..48ab3e3576 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom09.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom09.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom10.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom10.png index 40fc152483..724805919f 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom10.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom10.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom11.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom11.png index b7ee551e29..dc7397dd32 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom11.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom11.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom12.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom12.png index cdee556889..2ecf33bf0a 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom12.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom12.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom13.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom13.png index 76fea3644c..3b035d46ad 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom13.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom13.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom14.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom14.png index 28d2889db1..184eb8f4b1 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom14.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom14.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom15.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom15.png index 5ba5ad7b91..85aee44855 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom15.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom15.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom16.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom16.png index 915d4177b9..4c39ab4520 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom16.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom16.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom17.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom17.png index ca89c2d5a5..b925c229e5 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom17.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom17.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom178.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom178.png deleted file mode 100644 index 064be357fc..0000000000 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom178.png and /dev/null differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom18.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom18.png index 2443f9e914..0f86268494 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom18.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom18.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom19.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom19.png index 391d3313fc..e21726de9a 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom19.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom19.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom20.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom20.png deleted file mode 100644 index 2540281ada..0000000000 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom20.png and /dev/null differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom21.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom21.png index 2cd2ce0a1c..1c17684c03 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom21.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom21.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom22.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom22.png index 4bd5d03551..75dc1bdf6a 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom22.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom22.png differ diff --git a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom23.png b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom23.png index 72c431f40a..04e85114f5 100644 Binary files a/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom23.png and b/versioned_docs/version-3.13/assets/use-cases/tekton-custom/tekton-custom23.png differ diff --git a/versioned_docs/version-3.13/use-cases/tekton-custom-pipelines.md b/versioned_docs/version-3.13/use-cases/tekton-custom-pipelines.md index b2e382be59..2ccf22fb92 100644 --- a/versioned_docs/version-3.13/use-cases/tekton-custom-pipelines.md +++ b/versioned_docs/version-3.13/use-cases/tekton-custom-pipelines.md @@ -14,28 +14,32 @@ sidebar_label: "Deploy Application With Custom Build Tool/Framework" This use case demonstrates how to implement custom CI/CD pipelines within the KubeRocketCI platform to address project-specific requirements. -KubeRocketCI extends this capability by supporting the **customization** of Applications (Components) and Tekton pipelines, allowing teams to integrate and develop functionalities or services not readily available on the platform. +KubeRocketCI extends this capability by supporting the **customization** of Applications (Projects) and Tekton pipelines, allowing teams to integrate and develop functionalities or services not readily available on the platform. ## Goals +The goal of this is to configure KubeRocketCI in a way to: + - Incorporate and manage custom Tekton pipeline libraries that addresses project requirements. - Modify existing pipelines and tasks within these libraries to align with specific developmental goals and introduce novel functionalities. - Facilitate a swift setup and implementation process, enabling teams to focus on development without being hindered by platform limitations. ## Preconditions +Before starting this use case, ensure that: + - KubeRocketCI instance with GitHub and Tekton is [configured](../operator-guide/prerequisites.md); - Developer has access to the KubeRocketCI instances using the Single-Sign-On approach; - Developer has `Write` permissions for GitHub repository to merge the code; -- Configured Argo CD instance with the [Add-ons repository](../operator-guide/add-ons-overview.md) added. +- Argo CD instance is configured with the [Add-ons repository](../operator-guide/add-ons-overview.md) added. ## Scenario To streamline the process of implementing custom logic within the KubeRocketCI platform, follow this scenario: -- Add Custom Application: Begin by adding your application to the KubeRocketCI platform. -- Add Custom Tekton Library: Create and add a custom Tekton library designed to implement the CI/CD logic required by your application. -- Validate the Implementation: After setting up your Application and Tekton library, conduct testing to ensure that the pipelines execute as intended. +- **Add Custom Application**: Begin by adding your application to the KubeRocketCI platform. +- **Add Custom Tekton Library**: Create and add a custom Tekton library designed to implement the CI/CD logic required by your application. +- **Validate the Implementation**: After setting up your Application and Tekton library, conduct testing to ensure that the pipelines execute as intended. ### Add Custom Application to KubeRocketCI @@ -44,49 +48,63 @@ To streamline the process of implementing custom logic within the KubeRocketCI p This encompasses scenarios where the default pipeline configurations and toolchains are unable to meet the unique requirements of the application, thereby requiring the development and integration of tailored solutions. ::: -1. Open the KubeRocketCI portal. Use the **Sign-In** option: +1. Log in to the KubeRocketCI portal: + + ![Logging Page](../assets/use-cases/general/login-1.png "Logging screen") - ![Logging Page](../assets/use-cases/general/login.png "Logging Screen") +2. On the main menu, click the **Manage Namespaces** button: -2. In the top right corner, enter the `Account settings` and ensure that both `Default namespace` and `Allowed namespace` are set: + ![Manage Namespaces](../assets/use-cases/general/settings-1.png "Manage Namespaces button") - ![Settings](../assets/use-cases/tekton-custom/cluster-settings.png "Cluster Settings") +3. Ensure the `Namespace` value points to the namespace with the KubeRocketCI installation: -3. Select the **Components** tab and push the create **+ CREATE COMPONENT** button: + ![Default and allowed namespaces](../assets/use-cases/fastapi-scaffolding/default-allowed-namespace.png "Default and allowed namespaces") - ![Components Overview](../assets/use-cases/tekton-custom/components.png "Components Overview") + :::note + Don't forget to press Enter to add the namespace to the allowed namespaces list. + ::: -4. Choose the `Application` type since it is intended for containerization and deployment within a Kubernetes cluster. Click the **Next** button. +4. Select the **Projects** section and click **+ Create project**: - ![Create Application Menu](../assets/use-cases/tekton-custom/tekton-custom01.png "Create Application Menu") + ![Projects tab](../assets/use-cases/general/components-1.png "Projects tab") -5. Choose the `Clone` strategy, since we are cloning the application from the existing repository: +5. Create a new Project of the `Application` type using the `Clone` strategy since we are cloning the application from the existing repository: ![Clone Project](../assets/use-cases/tekton-custom/tekton-custom02.png "Clone Project") -6. In the **Add component info** tab, define the following values and click the **Proceed** button: +6. In the **Git & project info** tab, define the following values and click the **Continue** button: - - Git Server: select the available GitHub server - Repository URL: `https://github.com/epmd-edp/go-go-beego.git` + - Git Server: select the available GitHub server + - Owner: `github_account_name` - Repository name: `tekton-hello-world` - - Component name: `tekton-hello-world` + - Project name: `tekton-hello-world` + - Default branch: `main` - Description: `Custom tekton-hello-world application` + + ![Git & project info](../assets/use-cases/tekton-custom/tekton-custom03.png "Git & project info") + +7. In the **Build config** tab, define the values and click the **Continue** button: + + - Deployment option: `helm-chart` - Application code language: `Other` - Language version/framework: `go` - Build tool: `shell` + - Codebase versioning type: `semver` + - Start version from: `0.1.0` + - Suffix: `SNAPSHOT` - ![Application Menu](../assets/use-cases/tekton-custom/tekton-custom03.png "Application Menu") + ![Build config](../assets/use-cases/tekton-custom/tekton-custom04.png "Build config") -7. In the **Advanced Settings** tab, define the below values and click the **Create** button: +8. On the **Review** tab, verify the project configuration and click **Create project**: - - Default branch: `main` - - Deployment option: `helm-chart` - - Codebase versioning type: `semver` - - Leave `Specify the pattern to validate a commit message` empty. + ![Review and create](../assets/use-cases/tekton-custom/review-and-create.png "Review and create") + +9. On the congratulations page, click **View all projects**: - ![Application Menu](../assets/use-cases/tekton-custom/tekton-custom04.png "Application Menu") + ![Ready project](../assets/use-cases/tekton-custom/ready-component.png "Ready project") -8. Check the application status. It should be green. +10. Check the application status. It should be green: Now that the application is successfully created, proceed to adding the Tekton library to the KubeRocketCI platform. @@ -100,54 +118,64 @@ To streamline the process of implementing custom logic within the KubeRocketCI p name: github-$(tt.params.buildtool)-$(tt.params.framework)-$(tt.params.cbtype)-build-$(tt.params.versioning-type) ``` - This naming convention facilitates the automatic creation of PipelineRun instances in response to payload from GitHub during Merge Request events. + ```yaml + pipelineRef: + name: github-$(tt.params.buildtool)-$(tt.params.framework)-$(tt.params.cbtype)-review + ``` + + This naming convention facilitates the automatic creation of PipelineRun instances in response to payload from GitHub: the review pipeline runs during Merge Request events, and the build pipeline runs after the changes are merged. Ensure that the Pipeline name matches this structure to enable the correct triggering of pipeline executions. - In our case, the build pipeline name should be `github-shell-go-app-build-edp` + In our case, the build pipeline name should be `github-shell-go-app-build-semver` and the review pipeline name should be `github-shell-go-app-review`. ::: ### Add Tekton Library KubeRocketCI allows for the creation of custom Tekton libraries to address specific project requirements. This feature enables the modification of existing pipelines and tasks to align with the unique needs of the application. -1. Select the **Components** tab and push the create **+ CREATE COMPONENT** button: +1. Select the **Projects** tab and push the create **+ Create Project** button: - ![Components Overview](../assets/use-cases/tekton-custom/tekton-custom05.png "Components tab") + ![Projects tab](../assets/use-cases/tekton-custom/tekton-custom05.png "Projects tab") -2. Create a new Codebase with the `Library` type: +2. Select **Custom configuration**, **Library**, **Create** and click **Continue**: ![Create Library](../assets/use-cases/tekton-custom/tekton-custom06.png "Create Library") - -3. Select **Create from template** and click **Create** button: - - ![Create From Template](../assets/use-cases/tekton-custom/tekton-custom07.png "Create From Template") - + :::note The KubeRocketCI `Create` strategy will automatically pull the code for the Tekton Helm application from [the template](https://github.com/epmd-edp/helm-helm-pipeline.git). ::: -4. In the Application Info tab, define the following values and click the `Proceed` button: +3. In the **Git & project info** tab, define the following values and click the **Continue** button: + - Git Server: select the available GitHub server + - Owner: `github_account_name` - Repository name: `custom-tekton-chart` - - Component name: `custom-tekton-chart` + - Project name: `custom-tekton-chart` - Description: `Repository for storing and managing custom Tekton resources` + + ![Create From Template](../assets/use-cases/tekton-custom/tekton-custom07.png "Create From Template") + +4. In the **Build config** tab, define the values and click the **Continue** button: + - Application code language: `Helm` - Language version/framework: `Pipeline` - Build tool: `Helm` + - Default branch: `main` + - Codebase versioning type: `semver` + - Start version from: `0.1.0` + - Suffix: `SNAPSHOT` ![Codebase Info](../assets/use-cases/tekton-custom/tekton-custom08.png "Step codebase info") -5. In the `Advanced Settings` tab, define the below values and click the `Apply` button: - - - Default branch: `main` - - Codebase versioning type: `semver` - - Leave `Specify the pattern to validate a commit message` empty. +5. On the **Review** tab, verify the project configuration and click **Create project**: ![Advanced Settings](../assets/use-cases/tekton-custom/tekton-custom09.png "Advanced settings") -6. Check the codebases status: +6. On the congratulations page, click **View all projects**. - ![Components overview page](../assets/use-cases/tekton-custom/tekton-custom10.png "Codebase status") +7. Check the codebases' status: + + ![Projects overview page](../assets/use-cases/tekton-custom/tekton-custom10.png "Projects overview page") You have successfully added the custom Tekton library to the KubeRocketCI platform and are now ready to modify the Tekton pipeline to align with the specific requirements of your custom application. @@ -159,9 +187,9 @@ You have successfully added the custom Tekton library to the KubeRocketCI platfo Now that the Tekton Helm library is created, it is time to clone, modify and then apply it to the Kubernetes cluster. -1. In the Components tab, click one of the `custom-tekton-chart` to enter the application menu: +1. In the Projects tab, click one of the `custom-tekton-chart` to enter the application menu: - ![Components overview page](../assets/use-cases/tekton-custom/tekton-custom11.png "Codebase status") + ![Select overview page](../assets/use-cases/tekton-custom/tekton-custom11.png "Codebase status") 2. Navigate to **Branches** and click to the **Git** button: @@ -182,24 +210,24 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the │   │   │   ├── custom-clean.yaml │   │   │   └── custom-deploy.yaml │   │   ├── bitbucket-build-default.yaml - │   │   ├── bitbucket-build-edp.yaml + │   │   ├── bitbucket-build-semver.yaml │   │   ├── bitbucket-build-lib-default.yaml - │   │   ├── bitbucket-build-lib-edp.yaml + │   │   ├── bitbucket-build-lib-semver.yaml │   │   ├── bitbucket-review.yaml │   │   ├── gerrit-build-default.yaml - │   │   ├── gerrit-build-edp.yaml + │   │   ├── gerrit-build-semver.yaml │   │   ├── gerrit-build-lib-default.yaml - │   │   ├── gerrit-build-lib-edp.yaml + │   │   ├── gerrit-build-lib-semver.yaml │   │   ├── gerrit-review.yaml │   │   ├── github-build-default.yaml - │   │   ├── github-build-edp.yaml + │   │   ├── github-build-semver.yaml │   │   ├── github-build-lib-default.yaml - │   │   ├── github-build-lib-edp.yaml + │   │   ├── github-build-lib-semver.yaml │   │   ├── github-review.yaml │   │   ├── gitlab-build-default.yaml - │   │   ├── gitlab-build-edp.yaml + │   │   ├── gitlab-build-semver.yaml │   │   ├── gitlab-build-lib-default.yaml - │   │   ├── gitlab-build-lib-edp.yaml + │   │   ├── gitlab-build-lib-semver.yaml │   │   └── gitlab-review.yaml │   ├── resources │   │   └── npm-settings.yaml @@ -230,10 +258,10 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the 5. Modify and add tasks or pipelines. Consider the scenario where it's necessary to incorporate the `helm-lint` task into the review pipeline. - To achieve this, append the following code snippet to the `templates/pipelines/github-review.yaml` file, specifically below the `hello-world` task, located here: [github-review.yaml](https://github.com/epmd-edp/helm-helm-pipeline/blob/master/templates/pipelines/github-review.yaml#L114): + To achieve this, set the `metadata.name` field to `github-shell-go-app-review` and append the following code snippet to the `templates/pipelines/github-review.yaml` file, specifically below the `hello-world` task, located here: [github-review.yaml](https://github.com/epmd-edp/helm-helm-pipeline/blob/master/templates/pipelines/github-review.yaml#L114): ```yaml - apiVersion: tekton.dev/v1beta1 + apiVersion: tekton.dev/v1 kind: Pipeline metadata: name: github-shell-go-app-review @@ -275,13 +303,13 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the The `runAfter` parameter indicates the execution sequence, specifying that the `helm-lint` task is scheduled to run subsequent to the completion of the `hello-world` task. ::: - Also, in the `templates/pipelines/github-build-edp.yaml` file, specify the name `github-shell-go-app-build-edp` for the custom build pipeline: + Also, in the `templates/pipelines/github-build-semver.yaml` file, specify the name `github-shell-go-app-build-semver` for the custom build pipeline: ```yaml - apiVersion: tekton.dev/v1beta1 + apiVersion: tekton.dev/v1 kind: Pipeline metadata: - name: github-shell-go-app-build-edp + name: github-shell-go-app-build-semver ... ``` @@ -298,7 +326,7 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the ![Create pull request](../assets/use-cases/tekton-custom/tekton-custom15.png "Create pull request") -8. Check the GitHub code review for the custom Helm chart pipelines repository in KubeRocketCI. Navigate **Components** -> **Component name** and click to the review pipeline run: +8. Check the GitHub code review for the custom Helm chart pipelines repository in KubeRocketCI. Navigate to **Projects** -> **Project name** and click to the review pipeline run: ![KubeRocketCI pipelines overview](../assets/use-cases/tekton-custom/tekton-custom14.png "KubeRocketCI pipelines overview") @@ -306,7 +334,7 @@ Now that the Tekton Helm library is created, it is time to clone, modify and the ![Explore pipeline](../assets/use-cases/tekton-custom/tekton-custom16.png "Explore pipeline") -10. Go to the GitHub **Pull requests** -> **Add Helm chart testing for go-shell application** -> and click **Merge pull request**: +10. Go to the GitHub **Pull requests** -> **Add Helm chart testing for go-shell application** and click **Merge pull request**: ![Merge PR](../assets/use-cases/tekton-custom/tekton-custom17.png "Merge PR") @@ -316,13 +344,13 @@ To deploy custom pipelines to the cluster, you can use Argo CD, which includes a To deliver custom Tekton pipelines to the cluster, follow these steps: -1. Clone the forked repository with add-ons and make the following changes. In the `clusters/core/apps/values.yaml` file, set the `repoUrl` and `namespace` fields to specify the Git URL of the `tekton-custom-pipelines` repository and the namespace where the KubeRocketCI platform is deployed. Also, set the `kuberocketci-pipelines.enabled` field to `true` to enable the deployment of the `tekton-custom-pipelines` Argo CD Application: +1. Clone the forked repository with add-ons and make the following changes. In the `clusters/core/apps/values.yaml` file, set the `repoUrl` and `namespace` fields to specify the Git URL of the `custom-tekton-chart` repository and the namespace where the KubeRocketCI platform is deployed. Also, set the `kuberocketci-pipelines.enable` field to `true` to enable the deployment of the `kuberocketci-pipelines` Argo CD Application: ```yaml kuberocketci-pipelines: enable: true namespace: - repoUrl: ssh://git@github.com:22//tekton-custom-pipelines.git + repoUrl: ssh://git@github.com:22//custom-tekton-chart.git ``` 2. Commit and push the changes to the repository. @@ -335,9 +363,25 @@ To deliver custom Tekton pipelines to the cluster, follow these steps: git push origin main ``` -3. After pushing the changes, access **Argo CD**, navigate to the Application that corresponds to the repository with the **add-ons**, and initiate the `Sync` process. This will apply the `tekton-custom-pipelines` Helm Chart to the cluster within the specified namespace. +3. After pushing the changes, access **Argo CD**, navigate to the Application that corresponds to the repository with the **add-ons**, and initiate the `Sync` process. This will apply the `custom-tekton-chart` Helm Chart to the cluster within the specified namespace: + + ![Argo CD Sync](../assets/use-cases/tekton-custom/argocd-sync.png "Argo CD Sync") + +4. Open the **kuberocketci-pipelines** component by clicking the link button: + + ![KubeRocketCI pipelines component](../assets/use-cases/tekton-custom/open-krci-pipelines.png "KubeRocketCI pipelines component") + +5. Find the **github-shell-go-app-build-semver** pipeline and select **Details**: + + ![Select pipeline](../assets/use-cases/tekton-custom/select-pipeline.png "Select pipeline") - ![Argo CD Sync](../assets/use-cases/custom-tekton-pipelines/argocd-sync.png "Argo CD Sync") +6. On the resource window, click **Sync** -> **Synchronize**: + + ![Synchronize resource](../assets/use-cases/tekton-custom/synchronize-resource.png "Synchronize resource") + +7. Repeat the steps 5-6 for the **github-shell-go-app-review** pipeline: + + ![Synced pipelines](../assets/use-cases/tekton-custom/synced-pipelines.png "Synced pipelines") ### Create Application Merge Request @@ -345,30 +389,27 @@ Since we applied the Tekton library to the Kubernetes cluster in the previous st Perform the below steps to merge new code (Merge Request) that passes the Code Review flow. For the steps below, we use GitHub UI but the same actions can be performed using the command line and Git tool: -1. In the Components tab, click one of the `custom-tekton-chart` to enter the application menu. +1. In the Projects tab, click on the `tekton-hello-world` name to enter the application details page. -2. Navigate to **Branches** and click to the **Git** button: +2. Navigate to **Branches** and click to the branch name button: - ![Component's branch tab](../assets/use-cases/tekton-custom/tekton-custom18.png "Component's branch tab") + ![Project's branch tab](../assets/use-cases/tekton-custom/tekton-custom18.png "Project's branch tab") -3. Navigate to the **Branches** menu, create new branch from **New branch** menu with name `test`, and the click on the test branch: +3. Navigate to the **Branches** menu, create a new branch from the **New branch** menu with name `test`, and click on the test branch: ![Create Branch](../assets/use-cases/tekton-custom/tekton-custom19.png "Create Branch") -4. Change file `deploy-templates/values.yaml` with values below: +4. Change file `deploy-templates/values.yaml` by changing the `replicaCount` value: ```yaml ... - ingress: - enabled: true + replicaCount: 2 ... ``` - ![Create Merge Request](../assets/use-cases/tekton-custom/tekton-custom20.png "Create Merge Request") - -5. Navigate to the **Pull requests** -> **Compare & pull request** -> and click **Create pull request**: +5. Click **Pull requests** -> **Compare & pull request** -> and click **Create pull request**. -6. Check the Review Pipeline status. Navigate KubeRocketCI -> **Components** -> `tekton-hello-world` and click on review pipeline. The `helm-lint` task should be displayed there: +6. Check the Review Pipeline status. Navigate KubeRocketCI -> **Projects** -> `tekton-hello-world` and click on review pipeline. The `helm-lint` task should be displayed there: ![Explore Lint Step](../assets/use-cases/tekton-custom/tekton-custom21.png "Explore Lint Step")