@atomist/sdm
Version:
Atomist Software Delivery Machine SDK
29 lines • 1.28 kB
TypeScript
/**
* Determine cluster name from goal environment and fulfillment. If
* the fulfillment is provided, the cluster name is parsed from the
* goal fulfillment name, stripping any NPM scope and everything
* before the first underscore, `_`, if they exist.
*
* If there is no fulfillment, the cluster name derived from the goal
* environment. An environment of `StagingEnvironment` or
* `ProductionEnvironment` is mapped to an appropriate string. Any
* other goal environment is simplified to the name of the
* environment. If the environment is not truthy an empty string is
* returned. Otherwise the `environment` string is returned
* unchanged.
*
* @param environment FulfillableGoalDetails.environment
* @param fulfillment GoalFulfillment.name
* @return cluster name
*/
export declare function getCluster(environment: string, fulfillment?: string): string;
/**
* Generate the tail of a goal label using [[getCluster]] to determine
* an appropriate deployment target.
*
* @param environment FulfillableGoalDetails.environment
* @param fulfillment GoalFulfillment.name
* @return Formatted phrase including cluster name
*/
export declare function getClusterLabel(environment: string, fulfillment?: string): string;
//# sourceMappingURL=cluster.d.ts.map