本文整理汇总了TypeScript中core/registry.Registry.pipeline.registerStage方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Registry.pipeline.registerStage方法的具体用法?TypeScript Registry.pipeline.registerStage怎么用?TypeScript Registry.pipeline.registerStage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core/registry.Registry.pipeline
的用法示例。
在下文中一共展示了Registry.pipeline.registerStage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
mock.inject(function() {
Registry.pipeline.registerStage({ key: 'a', useBaseProvider: true } as IStageTypeConfig);
Registry.pipeline.registerStage({ key: 'b', provides: 'a', cloudProvider: 'aws' } as IStageTypeConfig);
expect(Registry.pipeline.getConfigurableStageTypes([awsProviderAccount]) as any[]).toEqual([
{ key: 'a', useBaseProvider: true, cloudProviders: ['aws'] },
]);
}),
示例2:
preconfiguredJobs.forEach(preconfiguredJob => {
const { label, description, type, waitForCompletion, parameters } = preconfiguredJob;
const defaults = {
parameters: parameters.reduce(
(acc, parameter) => {
if (parameter.defaultValue) {
acc[parameter.name] = parameter.defaultValue;
}
return acc;
},
{} as any,
),
};
Registry.pipeline.registerStage({
label,
description,
key: type,
alias: 'preconfiguredJob',
addAliasToConfig: true,
restartable: true,
defaults,
component: PreconfiguredJobStageConfig,
executionDetailsSections: [PreconfiguredJobExecutionDetails, ExecutionDetailsTasks],
configuration: {
waitForCompletion,
parameters,
},
});
});
示例3: manifest
.config(() => {
if (SETTINGS.feature.versionedProviders) {
Registry.pipeline.registerStage({
label: 'Bake (Manifest)',
description: 'Bake a manifest (or multi-doc manifest set) using a template renderer such as Helm.',
key: 'bakeManifest',
templateUrl: require('./bakeManifestConfig.html'),
controller: 'BakeManifestConfigCtrl',
producesArtifacts: true,
cloudProvider: 'kubernetes',
controllerAs: 'ctrl',
executionDetailsSections: [BakeManifestDetailsTab, ExecutionDetailsTasks, ExecutionArtifactTab],
artifactExtractor: (fields: string[]) =>
ExpectedArtifactService.accumulateArtifacts<IArtifact>(['inputArtifacts'])(fields).map(
(a: IArtifact) => a.id,
),
artifactRemover: (stage: IStage, artifactId: string) => {
ArtifactReferenceService.removeArtifactFromFields(['expectedArtifactId'])(stage, artifactId);
const artifactMatches = (artifact: IArtifact) => artifact.id === artifactId;
stage.expectedArtifacts = get(stage, 'expectedArtifacts', []).filter(a => !artifactMatches(a));
stage.inputArtifacts = get(stage, 'inputArtifacts', []).filter(a => !artifactMatches(a));
},
validators: [{ type: 'requiredField', fieldName: 'outputName', fieldLabel: 'Name' }],
});
}
})
示例4: module
module(APPLY_SOURCE_SERVER_GROUP_CAPACITY_STAGE, []).config(() => {
Registry.pipeline.registerStage({
synthetic: true,
key: 'applySourceServerGroupCapacity',
executionDetailsSections: [ApplySourceServerGroupCapacityDetails, ExecutionDetailsTasks],
});
});
示例5: module
module(UNMATCHED_STAGE_TYPE_STAGE, [UNMATCHED_STAGE_TYPE_STAGE_CTRL]).config(() => {
Registry.pipeline.registerStage({
key: 'unmatched',
synthetic: true,
templateUrl: require('./unmatchedStageTypeStage.html'),
});
});