The Associate a Build with a Component call ties a build number with a specified Component. It is typically used from build engines such as Jenkins to notify DeployHub that a new build has been performed. If the Component is associated with an approved Application then a new Version of the Component and Application is created automatically. The new Component Version replaces the old one in the newly created Application Version.


For this to work through the DeployHub permission model, the associated “Create Application Version” task needs to be specified. This ensures that the invoking User has permission to create a new Version of the Application (since the permissions are checked against the named task) and also the target Domain (i.e.: the Domain in which the new Application is created) is determined from the task. By specifying the task to execute, any pre and post link actions are executed just as if the task had been invoked via the Web UI.

API Call


http://host/dmadminweb/API/buildid/comp_id/build_id?taskname=task_id

[&branch=branch_id]

[&commit=commit_id]

[&issue=issue[&issue=issue]...] | [&issues=issuelist]

[&file=filename[&file=filename]...] | [&files=filelist]


Where:

Host

Is the hostname and port of the DeployHub (e.g.: hostname:8080 or for SaaS console.deployhub.com).

comp_id

Is the ID of a Component Base Version. DeployHub will find the latest Version of this Component and associate the build with that Component Version. If branch is specified, then the latest Version on the branch is located. The Component can be specified using either its name, its qualified name (i.e.: with its parent Domain(s) included in dot notation) or its internal ID.

build_id

Is the numeric build ID to associate with the latest Version of comp_id.

task_id

Is the identifier of a "Create New Application" task to execute in order to create the new Application Version. Either its name, its qualified name (i.e.: with its Domain and any parent Domain(s) included in dot notation) or its internal ID.

commit

Is the commit ID which triggered the build.

Issue

Is a Change Request id to associate with this build. If you add an issue then the specified Component must have an associated Change Request Data Source associated with it. This is because DeployHub will query the change tracking tool in order to retrieve the description of the change and the current status. If the Component does not have such a Data Source an error is returned.  You can specify one or more issue parameters if you need to associate multiple Change Request with this build or use the issues parameter to specify multiple change requests.

Issues

Is a comma-separated list of change request ids. This is equivalent to specifying multiple issue parameters.

File

Is a filename to record against the build. This is typically a file that was changed that resulted in a build being performed. You can specify one or more file parameters if you need to associate multiple files with this build or use the files parameter to specify multiple files.

files

Is a comma-separated list of files. This is equivalent to specifying multiple file parameters.


Example Result:


{

       success: true

}