Application branches

Introduction

Applications in redpesk hosted a branch notion that is about to be explained in this section, from branch creation, to package build for specific distribution, to branch deletion.

Branch notion for applications is the same logic as a git branch. Depending of the selected branch, packaging files or settings may differ.

So the good practice, described in the following chapters, is to define one branch per distribution.

Presentation

Branch in redpesk is an isolated environment in which the package can have its own sources, version, release and settings.

More than an isolated environment, branches are a key point when dealing with specific package sources for specific distribution. The relationship between application branches and distributions is expressed as follows:

  • A distribution is linked to exactly one branch
  • A branch can be linked to more than one distribution

A branch can have the following status:

  • Protected: The branch can’t be deleted
  • Default: Default application branch, always protected
  • Active: Branch currently working on

Each setting and file you retrieve from an application are always related to the current active branch, and can easily be changed by using your favorite client (Web IDE or rp-cli command line).

Creation / Deletion

When an application is about to be created, the name of its default branch can be customized (default is main). Keep in mind that the default branch of an application can never be deleted. Once the application is created, several distributions come with it, the one defined in its project parent.

On application creation, each distribution is linked to the default application branch. Thus, if nothing is done by the user, the same package sources will be used to build against each distribution set in the application.

Then, it is possible to create a new branch from another one but with custom attributes. Thus the new branch would share the same sources with the first branch, but with a different name and, possibly, different attributes, especially the link between branch and distribution.

Build

When launching a build of the application against a particular distribution, the sources hosted in the branch linked to this distribution will be built in the distribution environment.

When the application gathers multiple branches, it is important to keep an eye on which branch is built for which distribution.

In the WebUI, the link between distribution and application is located in the Branches Management section (located in ACTIONS tab of your application).

services

With redpesk-cli, run the following command:

devel@redpesk-devel: rp-cli applications branches list helloworld-binding -v
  main  	[ACTIVE][DEFAULT]	 (redpesk-lts-arz-1.1-update)