cluster

cluster is used to represent a set of machines or a container orchestration system. It is predominantly used to deploy services/apps to the specified cluster and in some cases it can also be used to run certain maintenance activities on the cluster as a whole.

You can create a cluster resource by adding it to shippable.yml.

resources:
  - name:           <string>
    type:           cluster
    integration:    <string>
    pointer:        <object>
  • name -- should be an easy to remember text string

  • type -- is set to cluster

  • integration -- name of the subscription integration, i.e. the name of your integration at https://app.shippable.com/subs/[github or bitbucket]/[Subscription name]/integrations. Currently supported integration types are:

  • pointer -- is an object that contains integration specific properties

    • For AWS integrations:

      pointer:
        region:     <AWS region, e.g., us-east-1, us-west-1, etc.>
        sourceName: <Amazon ECS cluster name>
      
    • For Azure integrations - N/A

    • For Kubernetes integrations:

      In Kubernetes you can specify the bastionHost information in the pointer section

       pointer:
         bastionHost:
           address:        <public address of your bastion host>
           user:           <bastionHost user>
           keyIntegration: <key_integration_resource> # Can be an sshKey or pemKey integration resource
      
    • For Docker Cloud integrations,

      pointer:
        sourceName: <Docker Cloud Cluster Name>
      
    • For Docker Datacenter integrations - N/A

    • For Google Cloud integrations:

      pointer:
        region:     <region, e.g., us-central1-a, us-west1-b, etc.>
        sourceName: <Google Container Engine cluster name>
        namespace:  <optional namespace you want to deploy to>
      
    • For Node Cluster integrations - N/A

    • For Joyent Triton integrations,
      pointer:
        region: <region eg., us-east-1, us-east-2, eu-ams-1, etc.>
      

Used in Jobs

This resource is used as an IN for the following jobs:

Default Environment Variables

Whenever cluster is used as an IN or OUT for a runSh or runCI job, a set of environment variables is automatically made available that you can use in your scripts.

<NAME> is the the friendly name of the resource with all letters capitalized and all characters that are not letters, numbers or underscores removed. For example, my-key-1 will be converted to MYKEY1, and my_key_1 will be converted to MY_KEY_1.

Environment variable Description
<NAME>_NAME The name of the resource.
<NAME>_ID The ID of the resource.
<NAME>_TYPE The type of the resource. In this case cluster.
<NAME>_INTEGRATION_<FIELDNAME> Values from the integration that was used. More info on the specific integration page.
<NAME>_OPERATION The operation of the resource; either IN or OUT.
<NAME>_PATH The directory containing files for the resource.
<NAME>_POINTER_REGION Region defined in the pointer. Available if the integration is AWS or Google.
<NAME>_POINTER_CLUSTERNAME ClusterName defined in the pointer. Available if the integration is Google.
<NAME>_POINTER_NAMESPACE Namespace defined in the pointer. Available if the integration is Google.
<NAME>_SOURCENAME SourceName defined in the pointer.
<NAME>_VERSIONID The ID of the version of the resource being used.
<NAME>_VERSIONNAME The versionName of the version of the resource being used.
<NAME>_VERSIONNUMBER The number of the version of the resource being used.

Shippable Utility Functions

To make it easy to use these environment variables, the platform provides a command line utility that can be used to work with these values.

How to use these utility functions is documented here.

Further Reading