Manage Branches
This page describes how to manage branches in the created component, whether it is an application, library, autotest or infrastructure. It also briefly explains two approaches of managing custom pipelines for codebases.
Pipeline Managementβ
There are two approaches to define a codebases with Tekton pipelines:
- Using build tool and framework
- Using codebase branch settings
Build Tool/Framework Approachβ
This approach involves adding your application operating with language type and framework.
In this approach, it is essential to create a pipeline name using the pattern: git_server_name-build_tool-framework-codebase_type-pipeline_type-codebase_versioning_type
.
Follow this approach if you need to define multiple similar applications with identical settings, as this approach would be more beneficial.
Codebase Branch Settingsβ
This approach involves creating a component with Tekton pipelines and selecting it in the codebase branch settings.
In contrast to the approach based on build tool and framework, this one offers two main advantages:
- Simplified management: This method eliminates the requirement for strict resource naming conventions. With this approach, pipelines can be created without following any predefined pattern.
- Branch-based logic: With this method, pipelines can be defined not just for an application but also for specific branches within the application.
If you need to frequently and quickly redefine a build or review pipeline, this approach is highly recommended.
Add New Branchβ
When working with libraries, pay attention when specifying the branch name: the branch name is involved in the formation of the library version, so it must comply with the semantic versioning rules for the library.
When adding a component, the default branch is a main branch. In order to add a new branch, follow the steps below:
-
Navigate to the Branches block by clicking the component name link in the Components list.
-
Click the + Create branch button:
a. Branch name - type the branch name. Pay attention that this field remains static if you create a release branch. For the Clone and Import strategies: if you want to use the existing branch, enter its name into this field.
b. From commit hash - paste the commit hash from which the branch will be created. For the Clone and Import strategies: Note that if the From commit hash field is empty, the latest commit from the branch name will be used.
c. Build pipeline - select the build pipeline you want to use to build the application or leave the default one.
d. Review pipeline - select the review pipeline you want to use to review the application or leave the default one.
e. View diagram - view the pipeline to verify this is the exact pipeline you need:
To get the most out of managing build/review pipelines via KubeRocketCI portal, you should follow the Add-Ons approach for pipeline management.
- Click Edit YAML in the upper-right corner of the dialog to open the YAML editor and add a branch. Otherwise, fill in the required fields in the dialog:
Adding of a new branch is indicated in the context of the EDP versioning
type.
Edit Existing Branchβ
To edit branch properties, follow the steps below:
-
Navigate to the Branches block by clicking the library name link in the Libraries list.
-
Click the actions button and select Edit:
- Change the branch options and click Apply:
a. Select another pipeline from the drop-down list.
b. Click the View diagram button.
c. View the pipeline structure and verify these are the exact pipelines you need.
Build Branchβ
In order to build branch from the latest commit, do the following:
-
Navigate to the Branches block by clicking the library name link in the Libraries list.
-
Click the Build button:
The pipeline run status is displayed near the branch name in the Branches block:
The corresponding item appears in the Pipelines section:
As an alternative way, click the tree diagram icon to observe the real-time status of the pipeline run:
The tree diagram window is presented below:
Delete Branchβ
The default master/main branch cannot be removed.
In order to delete the added branch with the corresponding record in the KubeRocketCI portal database, do the following:
- Navigate to the Branches block by clicking the component name link in the components list.
- Select the name related to the necessary branch and then click delete Bucket icon: