IBM COS Deployment Handler

Handles the deployment of one or more Deployment Packages to an IBM Cloud Object Store (COS) bucket.

The IBM Cloud Object Store bucket is described by:

apiKey
serviceInstanceId
endpointUrl
location
bucketName

And optionally:

prefix    

The contents of the Deployment Packages will be deployed sequentially to the target location. If any of the content within the Deployment Packages fails to copy, it will simply be skipped. Other content objects will be allowed to proceed unabated.

Configuration

{
    "apiKey": "{apiKey}",
    "serviceInstanceId": "{serviceInstanceId}",
    "endpointUrl", "{endpointUrl}",
    "location": "{location}",
    "bucketName": "{bucketName}",
    "prefix": "{prefix}"
}

The prefix setting is optional. All other settings are required.

Mappings

The IBM COS Deployment handler respects the f:deployment-config feature if applied to a node. This feature lets you configure a set of mappings that determine how a node's JSON object and any binary attachments should be mapped down and written to disk.

The default mappings are:

[{
    "type": "object-to-file",
    "config": {
        "filepath": "/{{dependency.id}}/{{dependency.typeId}}.json"
    }
}, {
    "type": "attachment-to-file",
    "config": {
        "attachmentId": "*",
        "filepath": "/{{dependency.id}}/{{attachment.filename}}"
    }
]

These default mappings make it so that your Node's JSON is written to the bucket along with any of its attachments.

  • Nodes are written to disk like this:

    {prefix}/{nodeId}/node.json

  • Node attachments are written as well, like this:

    {prefix}/{nodeId}/attachments/{attachmentId}.{ext}

  • Associations are written to disk like this:

    {prefix}/{associationId}/association.json

  • Association attachments are written as well, like this:

    {prefix}/{associationId}/attachments/{attachmentId}.{ext}

Example

{
    "apiKey": "dUOFEGj17XNBFr_Q01YMYdF7tXd0YuoA7DnjXRcmatum",
    "serviceInstanceId": "crn:v1:bluemix:public:test-object-storage:global:a/65862992d461491d441439914e1e937c:350e442e-0f17-40f4-965e-b063ce5d1f78::",
    "endpointUrl", "https://s3.us-south.test-object-storage.appdomain.cloud",
    "location": "us",
    "bucketName": "test-deployment-target-bucket",
    "prefix": "/static"
}