#
Integration of a new product
This chapter is intended for those who want to integrate their own Product to be deployed with BDeploy. Therefor a couple of YAML files are required. These files describe your product and all its applications together with some additional metadata. These artifacts are required:
YAML file to describe a single Application. It is required once for every client and server Application of the product.
YAML file with metadata for the whole product
YAML file required for every Product Version
Optional YAML file(s) which can be used to define Application Templates
Optional YAML file(s) which can be used to define Instance Templates
Optional YAML file(s) which can be used to provide shared definitions for parameters which are re-usable in
Optional YAML file(s) which can be used to provide shared definitions for instance variables which are re-usable in
Optional YAML file(s) which can be used to provide instance variable definitions for the product. Whenever instance uses the product, it will generate instance variables (if missing) based on those definitions.
Actually not part of any product itself. Freestanding description that can be used to create multiple instances of multiple products in one go
A configuration file which references all the YAML files which should be part of a product pre-validation
Note
You can find some zipped sample products on the BDeploy Releases Page.
This picture illustrates the relation between the various YAML files which are (can be) used to define a product. Almost all product information and data revolves around BDeploy enabling a user to configure instances and applications.
#
app-info.yaml
The app-info.yaml
file is one of the most important parts of BDeploy. It describes an Application, especially its start command. This Application may be any application which contains an executable (script, executable, etc.) and which allows 'installation' by copy to a directory. This is important, as BDeploy will 'install' an application by ultimately copying the application to an automatically determined internal directory and launch it from there.
Tip
An Application should not modify files in its own installation directory (although it can do it). BDeploy tries to aggressively pool applications per version to reduce the footprint on the disc. If this does not work for your application, use the pooling configuration to specify different behaviour.
Warning
runtimeDependencies
of Applications are always considered GLOBAL
poolable.
Warning
Client applications are always considered for GLOBAL
pooling by the client launcher.
Basically, app-info.yaml
allows you to specify which executable to run, and which parameters could potentially be used to configure the Application. The app-info.yaml
does not specify an actual configuration, but describes all possible parameters for an Application.
The app-info.yaml
file must be placed in the root directory of the Application it describes.
name: "My Application" <1>
type: CLIENT <2>
pooling: GLOBAL <3>
supportedOperatingSystems: <4>
- LINUX
- WINDOWS
branding: <5>
icon: "branding/my-icon.ico"
splash:
image: "branding/my-splash.bmp"
textRect:
x: 20
y: 174
width: 400
height: 20
foreground: "#000000"
progressRect:
x: 15
y: 194
width: 450
height: 12
foreground: "#333333"
processControl: <6>
supportedStartTypes:
- INSTANCE
supportsKeepAlive: true
noOfRetries: 5
gracePeriod: 3000
attachStdin: false
startupProbe: <7>
endpoint: "Startup Endpoint"
livenessProbe: <8>
endpoint: "Liveness Endpoint"
initialDelaySeconds: 5
periodSeconds: 10
configDirs: "/dir1,/dir2" <9>
supportsAutostart: true
startCommand: <10>
launcherPath: "{{WINDOWS:launch.bat}}{{LINUX:launch.sh}}"
parameters:
- id: "my.param.1"
name: "My numeric parameter"
longDescription: "This is a numeric parameter"
groupName: "My Parameters"
parameter: "--number"
defaultValue: "{{X:instance-number}}" <11>
type: NUMERIC
- id: "my.param.2"
name: "My textual parameter"
longDescription: "This is a textual parameter"
groupName: "My Parameters"
parameter: "--text"
mandatory: true
suggestedValues:
- "Value 1"
- "Value 2"
- id: "my.param.3"
name: "My conditional parameter"
longDescription: "This is only visible and configurable if my.param.2 has value 'Value 1'"
parameter: "--conditional"
mandatory: true
condition: <12>
parameter: "my.param.2"
must: EQUAL
value: "Value 1"
- template: param.template <13>
stopCommand: <14>
...
endpoints: <15>
http:
- id: "my-endpoint" <16>
path: "path/to/the/endpoint"
port: "{{V:port-param}}" <17>
secure: false
- id: "Startup Endpoint"
type: PROBE_STARTUP <18>
path: "startup/endpoint"
port: "{{V:port-param}}"
secure: false
- id: "Liveness Endpoint"
type: PROBE_ALIVE <18>
path: "liveness/endpoint"
port: "{{V:port-param}}"
secure: false
runtimeDependencies: <19>
- "adoptium/jre:1.8.0_202-b08"
- A human readable name of the Application. Will be displayed in the Configure Application pane, and is also used as default name for any process instantiated from this Application.
- The type of the application, may be
SERVER
orCLIENT
.SERVER
applications can be deployed to Nodes (including the master) and there be started as server processes.CLIENT
applications in comparison cannot be deployed on a Node, but run on a client PC instead. - The supported pooling type for server applications. Supported values are
GLOBAL
,LOCAL
andNONE
.GLOBAL
means that the application is fully poolable and may be installed once (per application version) and used by multiple instance versions of multiple instances.LOCAL
means that there is limited pooling support, and the application may only be re-used inside a single instance (by multiple instance versions of that instance, e.g. when changing only configuration).NONE
means that there is no pooling support and the application will be installed freshly per instance version, even if just configuration values changed. This gives some control over how to deploy applications which write data into their installation directory at runtime - which should of course be avoided for better pool-ability. This setting is currently ignored by the client application launcher. Client applications are always globally pooled. - List of supported operating systems. This list is solely used to verify during import of the Product, that the Application actually supports the operating system under which it is listed in the
product-version.yaml
. - Only relevant for
CLIENT
applications: Thebranding
attribute controls the appearance ofCLIENT
type Applications when downloaded by the user. It can be used to specify anicon
(used to decorate desktop links created by the client installer), and asplash
screen. For thesplash
, you can fine tune the exact location used to display progress text and a progress bar while the application is downloaded to the client PC by the Launcher CLI. Paths are interpreted relative to the root folder of the Application. - Only relevant for
SERVER
applications: Process control parameters allow to fine tune howSERVER
type Applications are started and kept alive by BDeploy. For details, see the list ofprocessControl attributes. - A startup probe can specify an HTTP Endpoint of type
PROBE_STARTUP
which is queried by BDeploy if specified until the endpoint returns a status code >= 200 and < 400. Once this happens, the startup probe is considered to be successful and the Process state advances from starting to running. The exact response reported by the Process is available from the Process details panels Process Probes section. - A liveness probe can specify an HTTP Endpoint of type
PROBE_ALIVE
along with an initial delay in seconds and an interval in which the probe is queried. BDeploy starts querying liveness probes only after the application entered running state. This happens either automatically when the process is started (if no startup probe is configured), or once the existing startup probe succeeded. The liveness probe is queried everyperiodSeconds
seconds, and the application is considered to be alive if the endpoint returns a status code >= 200 and < 400. If the probe fails, the Process status is updated to indicate the problem. The exact response reported by the Process is available from the Process details panels Process Probes section. - Allowed configuration directories preset - only valid for
CLIENT
applications. These relative sub-directories of the configuration files directory tree will be made available to this application when run on a client PC. This can later also be configured per process using the Allowable Configuration Directories configuration. - The start command of the Application. Contains the path to the executable to launch, as well as all known and supported parameters. For details, see the full list of
parameter attributes. To apply e.g. instance-specific values, Variable Expansion is a powerful tool. It can be used for thelauncherPath
and each parameter'sdefaultValue
. In the Web UI it can be used for the parameter values. - Variable Expansion can also be used to expand to Instance Variables in default values. These instance variables are required to exist once the application is configured in an instance. They can either be pre-provided using Instance Templates or need to be manually created when required.
- A conditional parameter is a parameter with a condition on it. The condition always refers to another parameter of the same application. The parameter with the condition set will only be visible and configurable if the condition on the referenced parameter is met.
- A product can provide
parameter templates which can be re-used by referencing their ID inline in applications parameter definitions. All parameter definitions in the template will be inlined at the place the template is referenced. - The optional stop command can be specified to provide a mechanism for a clean application shutdown once BDeploy tries to stop a process. This command may use Variable Expansion to access parameter values of the
startCommand
(e.g. configured 'stop port', etc.). It is not configurable through the Web UI though. All parameter values will have their (expanded) default values set when the command is run. If nostopCommand
is specified, BDeploy will try to gracefully quit the process (i.e.SIGTERM
). Both with and withoutstopCommand
, BDeploy resorts to aSIGKILL
after the has expired.gracePeriod
- Optional definition of provided endpoints. Currently only HTTP endpoints are supported. These endpoints can be configured on the application later, including additional information like authentication, certificates, etc. BDeploy can later on call these endpoints when instructed to do so by a third-party application.
- The ID of the endpoint can be used to call the endpoint remotely by tunneling through potentially multiple levels of BDeploy servers.
- Variable Expansion can be used on most of the endpoint properties.
- The type of the endpoint can be used to control how the endpoint is handled by BDeploy.
- Optional runtime dependencies. These dependencies are included in the Product when building it. Dependencies are fetched from Software Repositories.
launcherPath
and parameterdefaultValue
(and of course the final configuration values) can access paths within each of the dependencies by using the{{M:adoptium/jre}}
Variable Expansion, e.g.launcherPath: {{M:adoptium/jre}}/bin/java
. Note that the declared dependency does not need to specify an operating system, but must specify a version. This will be resolved by BDeploy to either an exact match if available, or a operating system specific match, e.g.adoptium/jre/linux:1.8.0_202-b08
onLINUX
. When referencing the dependency in a Variable Expansion, neither an operating system nor a version is required - in fact it must not be specified.
#
Supported processControl
attributes
Note
Some processControl
attributes are only supported for SERVER
applications, while others are only for CLIENT
applications.
The mock app-info.yaml above is marked as a CLIENT
application, but it still lists all process control attributes. This would be nonsencial in a real environment - only the applicable attributes should be used.
#
Supported parameters
attributes
Note
Parameters appear on the final command line in the exact order as they appear in the app-info.yaml
file, regardless of how they are presented in the Web UI, or how they are grouped using the groupName
attribute. This allows to build complex command lines with positional parameters through app-info.yaml
.
id
Default:
Mandatory: yes
Description: A unique ID of the parameter within the whole product which will contain the Application described by this app-info.yaml
.
name
Default:
Mandatory: yes
Description: A human readable name of the parameter used as label in the configuration UI.
longDescription
Default:
Mandatory: no
Description: An optional human readable description of the paramater, which is displayed in an info popover next to the parameter in the Web UI.
groupName
Default:
Mandatory: no
Description: An optional group name. The configuration UI may use this information to group parameters with the same groupName
together.
Caution
Although parameters in the UI are grouped together (and thus might change order), the order in which parameters appear on the final command line is exactly the order in which they are defined in the app-info.yaml
file.
suggestedValues
Default:
Mandatory: no
Description: An optional list of suggested values for parameters of type STRING
(the default). The Web UI will present this list when editing the parameter value.
parameter
Default:
Mandatory: yes
Description: The actual parameter, e.g. --parameter
, -Dmy.system.prop
, etc.
Note
The value of the parameter is not part of this definition, nor is any potential value separator (e.g. =
).
hasValue
Default: true
Mandatory: no
Description: Whether the parameter has a value or not. If the parameter has no value, it is treated as BOOLEAN
type parameter (i.e. it is either there (true
) or not (false
)).
valueAsSeparateArg
Default: false
Mandatory: no
Description: Whether the value of the parameter must be placed as a separate argument on the command line. If not, the value (if hasValue
) will be concatenated to the parameter
using the valueSeparator
.
valueSeparator
Default: =
Mandatory: no
Description: The character (sequence) to use to concatenate the parameter
and the actually configured value of it together. Used if not valueAsSeparateArg
.
defaultValue
Default:
Mandatory: no
Description: A default value for the parameter. The default value may contain variable references according to the Variable Expansion rules.
global
Default: false
Mandatory: no
Description: Whether this parameter is global
. This means that inside a single Instance, every process requiring this parameter will receive the same value. The configuration UI will provide input fields for the parameter for every Application which requires the parameter, and propagate value changes to all other Applications requiring it.
mandatory
Default: false
Mandatory: no
Description: Whether the parameter is required. If the parameter is not required, it is by default not put on the command line and must be added manually through a dedicated dialog on the configuration page.
fixed
Default: false
Mandatory: no
Description: Whether the parameter is fixed. This means that the parameter can not be changed by the user.
Consider a command line like this:
/path/to/java/bin/java -Dmy.prop=value -jar application.jar
In this case you will want the user to be able to edit the value of -Dmy.prop
parameter, but the user may never be able to edit the -jar application.jar
part. A definition for this command line would look like this:
startCommand:
launcherPath: "{{M:openjdk/jre:1.8.0_u202-b08}}/bin/java{{WINDOWS:w.exe}}"
parameters:
- id: "my.prop"
name: "My Property"
parameter: "-Dmy.prop"
mandatory: true
- id: "my.jar"
name: "Application JAR"
parameter: "-jar"
defaultValue: "application.jar"
valueAsSeparateArg: true
mandatory: true
fixed: true <1>
The fixed flag will cause the parameter to always use the defined default value and disable editing in the configuration UI.
type
Default: STRING
Mandatory: no
Description: Type of parameter. This defines the type of input field used to edit the parameter. Available are STRING
, NUMERIC
, BOOLEAN
, PASSWORD
, CLIENT_PORT
, SERVER_PORT
. Since 5.6.0, ENVIRONMENT
is available as an additional type.
The CLIENT_PORT
and SERVER_PORT
types are treated like NUMERIC
parameters throughout the whole application, with the exception of the dialogs that deal with ports specifically.
The ENVIRONMENT
type will cause a parameter to be put in the process' environment instead of its command line. The name of the environment variable is specified using the parameter
field. The fields hasValue
, valueAsSeparateArg
and valueSeparator
must not be set on ENVIRONMENT
parameters, and are ignored. Instead the Operating System specific Environment Variable handling is applied.
customEditor
Default: STRING
Mandatory: no
Description: The id of a custom editor to be used when editing this parameter through the BDeploy Web UI. Custom editors can be contributed by Plugins which are either globally installed in the BDeploy server, or contributed dynamically by the product.
condition
Default:
Mandatory: no
Description: A conditional parameter is a parameter with a condition on it. The condition always refers to another parameter on the same application. The parameter with the condition set will only be visible and configurable if the condition on the referenced parameter is met.
A condition expression (isolated) looks like this:
condition:
parameter: "my.param.2"
must: EQUAL
value: "Value 1"
Or, in its newer form, the very same (but ultimately more powerful) using expression
would look like this:
condition:
expression: "{{V:my.param.2}}"
must: EQUAL
value: "Value 1"
The power comes from the ability to provide an arbitrary amount of Variable Expansions in the Link Expressions.
The condition block understands the following fields:
The must
field understands the following condition types:
Warning
Be aware that the condition on a parameter has a higher precedence than mandatory
. A mandatory
parameter whos condition is not met is still not configurable. As soon as the condition is met, it is automatically added to the configuration using its default value.
Tip
If possible, a parameter with a condition should be defined after the parameter referenced in the condition if the referenced parameter is mandatory. This will make a difference when an application configuration is initially created by drag & drop.
#
Supported endpoints.http
attributes
Note
Endpoints definitions are templates which can later on be configured by the user. The only values not editable by the user are id
and path
.
Note
Endpoints which are not considered enabled are not required to be configured by the user, but are still reported via the public API.
#
product-info.yaml
Note
There is no actual requirement for the file to be named product-info.yaml
. This is just the default, but you can specify another name on the command line or in build tool integrations.
The product-info.yaml
file describes which Applications are part of the final Product, as well as some additional Product metadata.
name: My Product <1>
product: com.example/product <2>
vendor: My Company <3>
applications:
- my-app1 <4>
- my-app2
configTemplates: my-config <5>
pluginFolder: my-plugins <6>
applicationTemplates:
- 'my-templates/app-template.yaml' <7>
instanceTemplates:
- 'my-templates/template.yaml' <8>
parameterTemplates:
- 'my-templates/param-template.yaml' <9>
instanceVariableTemplates:
- 'my-templates/variable-template.yaml' <10>
instanceVariableDefinitions:
- 'my-definitions/instance-variable-definitions.yaml' <11>
versionFile: my-versions.yaml <12>
- A human readable name of the Product for display purposes in the Web UI.
- A unique ID of the Product which is used to base Instances of. This should not change, as changing the Product ID of an existing Instance is not supported.
- The vendor of the product. Displayed in the Web UI and used when installing client applications.
- The list of Applications which are part of the Product. These IDs can be anything, they just have to match the IDs used in the
product-version.yaml
referenced below. - Optional: A relative path to a directory containing configuration file templates, which will be used as the default set of configuration files when creating an Instance from the resulting Product.
- Optional: A relative path to a directory containing one or more plugin JAR files. These plugins are loaded by the server on demand and provided for use when configuring applications which use this very product version.
- A reference to an application template YAML file which defines an
.application-template.yaml
- A reference to an instance template YAML file which defines an
.instance-template.yaml
- A reference to a parameter template YAML file which defines a
.parameter-template.yaml
- A reference to an instance variable template YAML file which defines an
.instance-variable-template.yaml
- A reference to an instance variable definitions YAML file which defines an
instance-variable-definitions.yaml
- The
product-version.yaml
which associates the Application IDs (used above) with actual paths to Applications on the file system.
#
product-version.yaml
Note
There is no actual requirement for the file to be named product-version.yaml
as it is referenced from the product-info.yaml
by relative path anyway. This is just the default name.
The product-version.yaml
file associates Application IDs used in the product-info.yaml
with actual locations on the local disc. This is used to find and import each included Application when importing the Product.
The reason why this file is separate from the product-info.yaml
is because its content (e.g. version) is specific to a single product Build . Therefore the product-version.yaml
ideally is created during the build process of the product by the build system of your choice. This is different to the app-info.yaml
files and the product-info.yaml
file as they are written manually.
version: "2.1.0.201906141135" <1>
appInfo:
my-app1: <2>
WINDOWS: "build/windows/app-info.yaml" <3>
LINUX: "build/linux/app-info.yaml"
my-app2:
WINDOWS: "scripts/app2/app-info.yaml" <4>
LINUX: "scripts/app2/app-info.yaml"
- A unique Tag to identify the product version. There is no requirement for any version-like syntax here, it can be basically anything. It should just be unique per Product Version.
- The Application ID must match the one used in
product-info.yaml
. - You may have different binaries for a single application depending on the target operating system. It is not required to provide every application for every operating system. You can just leave out operating systems you don't care about.
- You can also use the exact same Application directory and
app-info.yaml
to satisfy multiple operating system targets for one Application.
#
application-template.yaml
Note
There is no actual requirement for the file to be named application-template.yaml
as it is referenced from the product-info.yaml
by relative path anyway. Multiple Application Template YAML files can exist and be referenced by product-info.yaml
.
This file defines a single Application Template. A product-info.yaml
id: server-with-sleep <1>
application: server-app
name: "Server With Sleep (Oracle)" <2>
processName: "Server With Sleep" <2>
description: "Server application which sleeps before exiting"
preferredProcessControlGroup: "First Group" <3>
applyOn: <4>
- LINUX
templateVariables: <5>
- id: sleep-timeout
name: "Sleep Timeout"
description: "The amount of time the server application should sleep"
defaultValue: 60
suggestedValues:
- '60'
- '120'
processControl: <6>
startType: MANUAL_CONFIRM
keepAlive: false
noOfRetries: 3
gracePeriod: 30000
attachStdin: true
startParameters: <7>
- id: param.sleep
value: "{{T:sleep-timeout}}"
- An Application Template must have an ID. This can be used to reference it from an Instance Template.
name
is the value user sees when they choose the template in UI.processName
is the name of the resulting process configuration.- The preferred process control group is used to determine which process control group to use when applying the application template. This is only used if a Process Control Group with this name exists in the instance configuration. Process Control Groups can be pre-configured in an
.instance-template.yaml
- A list of operating systems that this application may run on. If the node is running on an operating system that is not contained in the list, then the process will not be imported whenever an instance template references this application. If no list is present, then all operating systems are considered valid.
- A template can define (and use) template variables which are mandatory input by the user when using the template. A template variable can be referenced in parameter value definitions using the
{{T:varname}}
syntax. If the parameter value is numeric, you can also use simple arithmetic operations on the template variable like{{T:varname:+10}}
which will add 10 to the numeric value of the template variable. - A template can define arbitrary process control parameters to further control the default process control settings.
- Start command parameters are referenced by their ID, defined in
. If a value is given, this value is applied. If not, the default value is used. If a parameter is optional, it will be added to the configuration if it is referenced in the template, regardless of whether a value is given or not.app-info.yaml
Note
An Application Template can also extend another previously defined template. This works the same as the template
specifier in instance-template.yaml
fixedVariables
.
id: fixed-sleep
name: "Server With 10 Seconds Sleep"
template: server-with-sleep <1>
fixedVariables: <2>
- id: sleep-timeout
value: 10
- The
template
attribute specifies another application template (which must be registered in the product) to extend. All properties of that other template are merged into this application template. Properties of this template take precedence in case of a conflict. fixedVariables
, as also described for , allow to override the value of a specific template variable in this and the base template. Values queried from the user when applying this template will be ignored for any variable which has an overridden, fixed value.instance-template.yaml
#
Supported templateVariables
Attributes
Note
Defined templateVariables
can be used in the name
of the application template, as well as in each startParameter
s value
attribute.
#
Supported fixedVariables
Attributes
Fixed variables allow overriding template variable input from the user to a fixed value.
#
Supported startParameters
Attributes
The list of startParameters
provides control over the parameters in the resulting process. This is different from the parameter definition in app-info.yaml
#
instance-template.yaml
Note
There is no actual requirement for the file to be named instance-template.yaml
as it is referenced from the product-info.yaml
by relative path anyway. Multiple Instance Template YAML files can exist and be referenced by product-info.yaml
.
This file defines a single Instance Template. A product-info.yaml
name: Default Configuration <1>
description: "Creates an instance with the default server and client configuration"
templateVariables: <2>
- id: sleep-timeout
name: "Sleep Timeout"
description: "The amount of time the server application should sleep"
defaultValue: 60
instanceVariables: <3>
- id: var.id
value: "MyValue"
description: "The description of my instance variable"
type: PASSWORD
- template: var.template <4>
instanceVariableDefaults: <5>
- id: var.id
value: "A value other than above"
instanceVariableValues: <6>
- id: def.id
value: "A value that will update instance variable created from def.id definition"
- id: other.def.id
value: "{{T:sleep-timeout}}"
processControlGroups: <7>
- name: "First Group"
startType: "PARALLEL"
startWait: "WAIT"
stopType: "SEQUENTIAL"
groups: <8>
- name: "Server Apps"
description: "All server applications"
applications:
- application: server-app
name: "Server No Sleep"
description: "Server application which immediately exits"
- template: server-with-sleep <9>
fixedVariables: <10>
- id: sleep-timeout
value: 10
- application: server-app <11>
name: "Server With Sleep"
description: "Server application which sleeps before exiting"
applyOn: <12>
- LINUX
processControl:
startType: MANUAL_CONFIRM
startParameters: <13>
- id: param.sleep
value: "{{T:sleep-timeout}}"
applyTo: <14>
- LINUX
- name: "Client Apps"
type: CLIENT <15>
description: "All client applications"
applications:
- application: client-app
description: "A default client application."
- Each Instance Template has a name and a description, which are shown on the Instance Template Wizard.
- A template can define (and use) template variables which are mandatory input by the user when using the template. A template variable can be referenced in parameter value definitions using the
{{T:varname}}
syntax. If the parameter value is numeric, you can also use simple arithmetic operations on the template variable like{{T:varname:+10}}
which will add 10 to the numeric value of the template variable. - Instance Variables can be defined in an instance template. Those definitions will be applied to a new instance when this template is used. Link Expressions can then be used to expand to the Instance Variables values in parameters, configuration files, etc.
- Instance Variables can also be defined in an
file externally, and referenced via its ID.instance-variable-template.yaml
instanceVariableDefaults
allows to override the value of a previous Instance Variables definition in the same template. This is most useful when applying files using theinstance-variable-template.yaml
template
syntax ininstanceVariables
. The instance variable template can be shared more easily if instance templates have means of providing distinct values per instance template.instanceVariableValues
allows to override the value of an instance variable created frominstance-variable-definitions.yaml - Process Control Groups can be pre-configured for an instance template. If an application template later on wishes to be put into a certain Process Control Group, the group is created based on the template provided in the instance template. Note that the defaults for a Process Control Group in a template are slightly different from the implicit 'Default' Process Control Group in BDeploy. The defaults are:
startType
:PARALLEL
,startWait
:WAIT
,stopType
:PARALLEL
. - A template defines one or more groups of applications to configure. Each group can be assigned to a physical node available on the target system. Groups can be skipped by not assigning them to a node, so they provide a mechanism to provide logical groups of processes (as result of configuring the applications) that belong together and might be optional. It is up to the user whether a group is mapped to a node, or not. Multiple groups can be mapped to the same physical node.
- Instance Templates can reference Application Templates by their
id
. The Instance Templates can further refine an Application Template by setting any of the valid application fields in addition to the template reference. - When referencing an application template, it is possible to define overrides for the template variables (
{{X:...}}
) used in the template. Use provided values will not be taken into account for this variable when applying the template, instead the fixed value will be used. - A template group contains one or more applications to configure, where each application can consist of process control configuration and parameter definitions for the start command of the resulting process - exactly the same fields are valid as for Application Templates - except for the
id
which is not required. - A list of operating systems where this application will be applied. If the node is running on an operating system that is not contained in the list, then the application will not be imported. If no list is present, then all operating systems are considered valid.
- Start command parameters are referenced by their ID, defined in
. If a value is given, this value is applied. If not, the default value is used. If a parameter is optional, it will be added to the configuration if it is referenced in the template, regardless of whether a value is given or not.app-info.yaml
- Using
applyTo
, an application can be restricted to be applied only to certain nodes, running a specified operating system. A list of supported operating systems can be specified. If this is not specified, the application is assumed to be capable of being applied to nodes running any of all supported operating systems. - A template group can have either type
SERVER
(default) orCLIENT
. A group may only contain applications of a compatible type, i.e. onlySERVER
applications inSERVER
type group. When applying the group to a node, applications will be instantiated to processes according to their supported OS and the nodes physical OS. If aSERVER
application does not support the target nodes OS, it is ignored.
An instance template will be presented to the user when visiting an Empty Instance.
Warning
instanceVariables
and instanceVariableDefaults
have been deprecated (since 7.2.0) in favor of instanceVariableValues
and
#
Supported templateVariables
Attributes
Note
templateVariables
follows the same scheme as templateVariables
Attributesapplication-template.yaml
Note
Defined templateVariables
can be used in each instanceVariables
(and instanceVariableDefaults
) value
attribute, and per inline application in each field which is supported by application-template.yaml
templateVariables
.
#
Supported instanceVariables
Attributes
#
Supported instanceVariableDefaults
Attributes
#
Supported instanceVariableValues
Attributes
#
Supported processControlGroups
Attributes
#
Supported groups
Attributes
groups
is a list of template groups. This groups together a set of
#
parameter-template.yaml
A parameter-template.yaml
allows products to define re-usable blocks of parameters associated to a unique ID. These can then be applied in app-info.yaml
files. For the user of BDeploy, those parameters will appear as if they were defined directly in the app-info.yaml
id: param.template <1>
parameters: <2>
- id: tpl-param
name: "Template Parameter"
defaultValue: "x"
longDescription: "A parameter defined in a template"
- The ID can be used to reference the template afterwards from an
.app-info.yaml
- The
parameters
can contain an arbitrary amount of parameter definitions, which follow exactly the same schema assupported inparameters
attributes .app-info.yaml
Note
Inlining of templates into applications happens before anything else. Parameter templates can also reference other parameters (e.g. {{V:my-param}}
), even if they are not part of this very template. All applications using this parameter would then either have to have (directly or through another template) this my-param
parameter, or will receive a validation warning and need to change the value.
Warning
To be able to use a template, the template needs to also be registered in the product-info.yaml
#
instance-variable-template.yaml
An instance-variable-template.yaml
works the same as a parameter-template.yaml
in that it provides common definitions for instance variables, which can be re-used in instance-template.yaml
instance-variable-template.yaml
files can do exactly the same things as instanceVariables
in a instance-template.yaml
id: var.template <1>
instanceVariables: <2>
- id: "my-instance-var"
description: "My Instance Variable"
value: "My Value!"
type: STRING
- The ID can be used to reference the template afterwards from an
.instance-template.yaml
- An arbitrary amount of instance variable templates. The schema is the same as
supported ininstanceVariables
Attributesinstance-template.yaml
Warning
To be able to use a template, the template needs to also be registered in the product-info.yaml
Warning
Deprecated in favor of instance-variable-definitions.yaml
#
instance-variable-definitions.yaml
Note
There is no actual requirement for the file to be named instance-variable-definitions.yaml
as it is referenced from the product-info.yaml
by relative path anyway. Multiple Instance Variable Definitions YAML files can exist and be referenced by product-info.yaml
.
An instance-variable-definitions.yaml
provides definitions for instance variables, based on which instance variables will be created. The definition values can be overriden using instanceVariableValues
in an instance-template.yaml
definitions: <1>
- id: "my-instance-variable-definition"
name: 'My Instance Variable Definition'
longDescription: 'The description for instance variable definition'
type: 'STRING'
defaultValue: 'someDefaultValue'
groupName: 'Instance Variable Definitions Group'
- File consists of a single list of
definitions
containing an arbitrary amount of instance variable definitions.
#
Supported definitions
Attributes
Instance variable definitions support a subset of
#
system-template.yaml
A (freestanding) system-template.yaml
allows you to specify a broader scoped template than a (product-bound) instance-template.yaml
. A system-template.yaml
can reference multiple products, and Instance Templates therin to create systems containing of many instances from different products.
name: Test System
description: 'A test system with both demo and chat product'
systemVariables: <1>
- id: test.system.var
description: 'A test system variable'
value: testValue
templateVariables: <2>
- id: node-base-name
name: "The node base name"
defaultValue: "Node"
instances:
- name: 'Demo Instance' <3>
description: "The Test System's Demo Instance"
productId: 'io.bdeploy/demo'
productVersionRegex: "2\\..*"
templateName: 'Default Configuration'
- name: 'Chat Instance'
description: "The Test System's first Chat Instance"
productId: 'io.bdeploy/chat-app'
fixedVariables: <4>
- id: app-name
value: "{{T:node-base-name}}"
templateName: 'Default Configuration'
defaultMappings: <5>
- group: 'Chat App'
node: '{{T:cell-base-name}}'
- The single core artifact created on BDeploy using a System Template is - of course - a System. It is possible to define an arbitrary amount of System Variables using the template.
- Template variables in System Templates work similar to template variables in
. They can be used within theinstance-template.yaml
system-template.yaml
in instance names,fixedVariables
anddefaultMappings
. - A simple instance reference must consist of a
name
, aproductId
and atemplateName
, meaning "create an instance with namename
, from the productproductId
using the templatetemplateName
". fixedVariables
allows you to specify a "fixed" value for template variables used in the referenced Instance Template. This will skip querying the user for a value for that variable, and instead use this fixed value.defaultMappings
can be used to pre-assign Instance Template groups to available nodes. If a node with the specified name is not available during application of the System Template, no node will be preselected. To specify the Client Application node, you can either specify 'Client Applications' or the internal name '__ClientApplications'.
Note
When applying a System Template from the CLI, all mappings need to be provided through defaultMappings
, and all Template Variables of the System Template as well as downstream Template Variables (required by the individual Instance Templates) need to either have a default value or be provided using fixedVariables
, as the CLI is non-interactive when applying System Templates
#
Supported systemVariables
Attributes
#
Supported templateVariables
Attributes
Note
templateVariables
follows the same scheme as templateVariables
attributesapplication-template.yaml
Note
Defined templateVariables
can be used in each instances
name
, description
and defaultMapping
node
attributes. fixedVariables
on each instances
value can be used to propagate values further down the line into instance-template.yaml
#
Supported instance
Attributes
Each element provides a description of an instance to be created from a specific product and a specific instance template.
#
product-validation.yaml
The product-validation.yaml
file contains references to all files that should be sent to the server when performing a product pre-validation. This validation can be used to verify that the product and all its applications contain valid BDeploy YAML.
The content of this file is very straight forward:
product: product-info.yaml
applications:
my-application: app1/src/main/dist/app-info.yaml
other-application: app2/src/main/dist/app-info.yaml
This file can be passed to the remote-product-validation
CLI command, as well as to the BDeployValidationTask
Gradle task.
#
Building a Product
Now that you have a well-defined Product with one or more Applications, you will want to build/package that Product to be usable with BDeploy.
#
Via ZIP File and Web UI
The well-defined Product directory including Applications can be zipped and imported directly from the web interface.
The following conditions must be fulfilled for a successful import:
- ZIP files must be self-contained, e.g. only relative paths are allowed and no leaving of the zipped structure via ".." paths.
- YAML files must follow standard naming (product-info.yaml).
#
Via CLI
Once you have a product-info.yaml
with it's product-version.yaml
and all the app-info.yaml
files in their respective Application directories, you can use the CLI to import the product as a single piece.
- Use
bdeploy product
to import the product by specifying a local BHive and theproduct-info.yaml
to import from. - Use
bhive push
to push the resulting Product Manifest from the local BHive to an Instance Group on a remote BDeploy server.
#
Via Gradle
BDeploy provides a Gradle plugin. This plugin can be used to build a product out of your application.
Given a sample Java application which has been created from the default gradle template using gradle init
, these are the changes you need to build a BDeploy product for this single application. For this demo, the application is named test
.
Note
Add the below code to your existing build.gradle
.
plugins {
...
id 'io.bdeploy.gradle.plugin' version '3.1.1-1' <1>
}
version = "1.0.0-SNAPSHOT" <2>
ext { <3>
buildDate = new Date().format('yyyyMMddHHmmss')
buildVersion = project.version.replaceAll('SNAPSHOT', buildDate)
}
task validateProduct(type: io.bdeploy.gradle.BDeployValidationTask, dependsOn: installDist) { <4>
validationServer {
useLogin = true
}
validationYaml = file('bdeploy/product-validation.yaml')
}
task buildProduct(type: io.bdeploy.gradle.BDeployProductTask, dependsOn: installDist) { <5>
repositoryServer {
useLogin = true
}
product {
version = project.ext.buildVersion
productInfo = file('bdeploy/product-info.yaml')
applications {
test {
yaml = new File(installDist.destinationDir, 'app-info.yaml')
}
}
labels.put('buildDate', project.ext.buildDate)
}
}
task zipProduct(type: io.bdeploy.gradle.BDeployZipTask, dependsOn: buildProduct) { <6>
of buildProduct
output = new File(buildDir, "product-" + project.ext.buildVersion + ".zip");
}
task pushProduct(type: io.bdeploy.gradle.BDeployPushTask, dependsOn: buildProduct) { <7>
of buildProduct
target.servers {
myServer { <8>
useLogin = true
instanceGroup = project.getProperty('instanceGroup')
}
}
}
...
- Applies the plugin BDeploy gradle plugin.
- Sets the project version. Gradle does not strictly require a version, and uses 'unspecified' as default. BDeploy requires some sort of version, and setting it for the whole project is good practice.
- Calculate a build date, which will be substituted instead of the
SNAPSHOT
in the version. This is optional, you could just plainly use the version set. The actualbuildVersion
used later when building the product is derived from the project version and thebuildDate
. - The
BDeployValidationTask
can be used to validate product information before actually building the product. The file must contain a reference to theproduct-validation.yaml
product-info.yaml
used, as well as references to allapp-info.yaml
files. - This task will actually build the product with the configured version. The actual data about the product is loaded from
bdeploy/product-info.yaml
, which we will create in a second. Note that this task depends oninstallDist
, which will unpack the binary distribution of the application in this project into a folder, so BDeploy can import the individual files. Depending on the type of application and the way it is built, there might be different ways to achieve this.
TherepositoryServer
will be queried for additionally specifiedruntimeDependencies
at build time. Those dependencies will be downloaded and embedded into the final product. - If
buildProduct
built a product, this task will package it as a ZIP file. Note that a ZIP will always contain all of the product, whereaspushProduct
can push only required deltas which are not present on the target server. - The
pushProduct
task can push required deltas to one or more configured target servers. The server configuration is the same as for all other..Server
blocks (see note below). In addition the targetinstanceGroup
must be specified for pushing. - Multiple target servers can be specified in the
target.servers
section. The plugin will push to each of them.
Note
All ...Server
blocks can set useLogin = true
to use local logins created on the system using the bdeploy login
command. You can provide a login name using login = xx
, or specify uri
and token
instead of useLogin
to have full control. Where useLogin
is valid, loginStorage
can also be used to set a different directory where BDeploy logins are stored and can be read from.
Next we need the required descriptors for the product and the application. For this sample, the information will be the bare minimum, please see app-info.yaml
product-info.yaml
Lets start off with the app-info.yaml
test
application.
Note
This file must be part of the binary distribution of an application and reside in its root directory. To achieve this, the simplest way (using the gradle application
plugin) is to put the file in the subdirectory src/main/dist
in the project folder.
name: Test Application
supportedOperatingSystems: <1>
- LINUX
- WINDOWS
startCommand:
launcherPath: "{{M:SELF}}/bin/test{{WINDOWS:.bat}}" <2>
- By default, the BDeploy plugin will make this application available for all the supported platforms specified in
app-info.yaml
. If required (usually it is not) you can configure a different set of Operating Systems to build for in thetest
application configuration inbuild.gradle
by adding a set of operating system literals (e.g. 'WINDOWS', 'LINUX') to theos
list of the application. - This demo
app-info.yaml
only defines the path to the launcher, which for this demo project (namedtest
) isbin/test
onLINUX
, andbin/test.bat
onWINDOWS
.
Finally, we need a product-info.yaml
bdeploy
subfolder. This is not required, it can reside anywhere in the project. You just need to adapt the path to it in the build.gradle
.
Note
The reason why you want to put this file into a separate folder is because it allows to reference various other files by relative path. Those files (and folders) must reside next to the product-info.yaml
name: Test Product
product: io.bdeploy/test <1>
vendor: BDeploy Team
applications:
- test <2>
versionFile: product-version.yaml <3>
- This is the unique ID of the product. This is basically a 'primary key' and should not change over time.
- The
needs to list included applications. These applications also need to be available from theproduct-info.yaml
product-version.yaml
. - The
versionFile
parameter must be set. If the relative path given here does not exist, the BDeploy Gradle plugin will generate this file for you, using the given version and applications. Otherwise you can provide this file and have more manual control over applications. In case the plugin generates the file for you, it will be deleted right after the build.
That's all that is required to build a product. You can now run ./gradlew zipProduct
on the CLI to try it out. The result will be a build/product-1.0.0-XXX.zip
where XXX
is the buildDate
we set previously. The content of the ZIP file is a BHive, which is the internal data format used by BDeploy. You can upload this product to any BDeploy server using its Web UI.
Note
The build
folder also contains the BHive in unzipped form in the build/productBHive
folder. This folder is temporary but will hold all product versions built since the last ./gradlew clean
. You can use this BHive for manual pushing.
Note
The pushProduct
task will do the same thing (build the product) but then push it to a target server. For this, you need to specify the server
, token
and instanceGroup
project properties to match your setup. You can get a token by using the Create Token...
action on the user menu in BDeploy. Make sure to create a full token pack for this tool to work.
Warning
Using ./gradlew clean buildProduct
you can build the same product version over and over again. However once pushed to a remote server, the same product version must not be reused. If you try to build and push the same version more than once, the server will silently ignore your attempt to push, as it assumes that it already has all the content (it has a product with this version already, and all artifacts are assumed to be immutable in BDeploy).
#
Via Eclipse TEA
BDeploy provides integration into Eclipse TEA. Using this integration, you can easily export Eclipse RCP based products as Applications and bundle them into a custom Product.
Once you have required files, select TEA > TEA Build Library > Build BDeploy Product.... You will be prompted which Product to build and where to put the resulting product. You can choose to create a self-contained ZIP, or to push deltas to a selected server.
You can configure multiple servers by using the [ Add ], [ Delete ] and [ Edit ] buttons.
Enter a description and a URL. You will then be able to use the [ Login ] button to create a token for the server.
Now you can use the [ Load Groups ] to fetch a list of existing instance groups from the server to choose from. Finally, use the verify button to check whether the entered information is correct.
When confirming the build dialog, on first run you will be prompted to login to the Software Repositories BDeploy server configured in the TEA BDeploy preferences.
Since product builds are stored in the workspace, you can choose to re-push a previous build of the product (to the same or another server). Select TEA > TEA Build Library > Push BDeploy Product... to do so. You will be presented a list of available local product versions and the configured BDeploy servers.
#
products.yaml
Note
There is no actual requirement for the file to be named products.yaml
. This is just the default, but you can specify another name in the Eclipse TEA preferences.
This file is required and lists the product-build.yaml
products:
"Product One": "prod-1-build.yaml"
"Product Two": "prod-2-build.yaml"
The path to the products.yaml
has to be configured in the Eclipse TEA preferences.
The preferences also allow to configure a BDeploy server whos Software Repositories are used during resolution of Runtime Dependencies. You will be asked to log into this server once when starting a product build.
#
product-build.yaml
This file references a product-info.yaml
product-info.yaml
.
productInfoYaml: my-prod-info.yaml
applications:
- name: my-app1
type: RCP_PRODUCT
includeOs: [WINDOWS, LINUX]
application:
product: App1ProdBuild
- name: my-app2
type: RCP_PRODUCT
includeOs: [WINDOWS, LINUX]
application:
product: App2ProdBuild
The value for applications.application.product
is Eclipse TEA specific and references the Eclipse TEA product alias property.