本文整理汇总了TypeScript中core/registry.Registry.pipeline.registerTrigger方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Registry.pipeline.registerTrigger方法的具体用法?TypeScript Registry.pipeline.registerTrigger怎么用?TypeScript Registry.pipeline.registerTrigger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core/registry.Registry.pipeline
的用法示例。
在下文中一共展示了Registry.pipeline.registerTrigger方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: require
.config(() => {
Registry.pipeline.registerTrigger({
label: 'Webhook',
description: 'Executes the pipeline when a webhook is received.',
key: 'webhook',
controller: 'WebhookTriggerCtrl',
controllerAs: 'ctrl',
templateUrl: require('./webhookTrigger.html'),
validators: [
{
type: 'serviceAccountAccess',
message: `You do not have access to the service account configured in this pipeline's webhook trigger.
You will not be able to save your edits to this pipeline.`,
preventSave: true,
},
],
});
})
示例2: expect
mock.inject(function() {
expect(Registry.pipeline.getTriggerTypes().length).toBe(0);
Registry.pipeline.registerTrigger({ key: 'cron' } as ITriggerTypeConfig);
Registry.pipeline.registerTrigger({ key: 'pipeline' } as ITriggerTypeConfig);
expect(Registry.pipeline.getTriggerTypes().length).toBe(2);
}),
示例3: it
it('hasManualExecutionComponentForTriggerType returns handler if declared and available', function() {
const CompA = ({ }: ITriggerTemplateComponentProps) => React.createElement('a');
Registry.pipeline.registerTrigger({ key: 'cron', manualExecutionComponent: CompA } as ITriggerTypeConfig);
expect(Registry.pipeline.getManualExecutionComponentForTriggerType('cron')).toEqual(CompA);
});
示例4:
Registry.pipeline.registerTrigger({
label: 'Concourse',
description: 'Listens to a Concourse job',
key: 'concourse',
component: ConcourseTriggerConfig,
manualExecutionComponent: ConcourseTriggerTemplate,
excludedArtifactTypePatterns: [ArtifactTypePatterns.JENKINS_FILE],
validators: [
{
type: 'requiredField',
fieldName: 'team',
message: '<strong>Team</strong> is a required field on Concourse triggers.',
},
{
type: 'requiredField',
fieldName: 'project',
message: '<strong>Pipeline</strong> is a required field on Concourse triggers.',
},
{
type: 'requiredField',
fieldName: 'jobName',
message: '<strong>Job</strong> is a required field on Concourse triggers.',
},
{
type: 'serviceAccountAccess',
message: `You do not have access to the service account configured in this pipeline's Jenkins trigger.
You will not be able to save your edits to this pipeline.`,
preventSave: true,
},
],
});
示例5:
'use strict';
import { ArtifactTypePatterns } from 'core/artifact';
import { PipelineTrigger } from './PipelineTrigger';
import { PipelineTriggerTemplate } from './PipelineTriggerTemplate';
import { ExecutionUserStatus } from 'core/pipeline/status/ExecutionUserStatus';
import { Registry } from 'core/registry';
Registry.pipeline.registerTrigger({
component: PipelineTrigger,
description: 'Listens to a pipeline execution',
label: 'Pipeline',
key: 'pipeline',
excludedArtifactTypePatterns: [ArtifactTypePatterns.JENKINS_FILE],
executionStatusComponent: ExecutionUserStatus,
manualExecutionComponent: PipelineTriggerTemplate,
executionTriggerLabel: () => 'Pipeline',
});
示例6: excludeAllTypesExcept
import { Registry } from 'core/registry';
import { ArtifactoryTrigger } from './ArtifactoryTrigger';
import { ArtifactTypePatterns, excludeAllTypesExcept } from 'core/artifact';
Registry.pipeline.registerTrigger({
label: 'Artifactory',
description: 'Executes the pipeline on an Artifactory repo update',
key: 'artifactory',
component: ArtifactoryTrigger,
validators: [],
excludedArtifactTypePatterns: excludeAllTypesExcept(ArtifactTypePatterns.MAVEN_FILE),
});
示例7: excludeAllTypesExcept
import { GitTrigger } from './GitTrigger';
import { ArtifactTypePatterns, excludeAllTypesExcept } from 'core/artifact';
import { Registry } from 'core/registry';
import { GitTriggerExecutionStatus } from './GitTriggerExecutionStatus';
Registry.pipeline.registerTrigger({
component: GitTrigger,
description: 'Executes the pipeline on a git push',
executionStatusComponent: GitTriggerExecutionStatus,
excludedArtifactTypePatterns: excludeAllTypesExcept(
ArtifactTypePatterns.GITHUB_FILE,
ArtifactTypePatterns.GITLAB_FILE,
ArtifactTypePatterns.BITBUCKET_FILE,
),
key: 'git',
label: 'Git',
validators: [
{
type: 'serviceAccountAccess',
message: `You do not have access to the service account configured in this pipeline's git trigger.
You will not be able to save your edits to this pipeline.`,
preventSave: true,
},
],
});
示例8:
import { ArtifactTypePatterns } from 'core/artifact';
import { Registry } from 'core/registry';
import { TravisTrigger } from './TravisTrigger';
import { TravisTriggerTemplate } from './TravisTriggerTemplate';
Registry.pipeline.registerTrigger({
component: TravisTrigger,
description: 'Listens to a Travis job',
excludedArtifactTypePatterns: [ArtifactTypePatterns.JENKINS_FILE],
key: 'travis',
label: 'Travis',
manualExecutionComponent: TravisTriggerTemplate,
providesVersionForBake: true,
validators: [
{
type: 'requiredField',
fieldName: 'job',
message: '<strong>Job</strong> is a required field on Travis triggers.',
},
{
type: 'serviceAccountAccess',
message: `You do not have access to the service account configured in this pipeline's Travis trigger.
You will not be able to save your edits to this pipeline.`,
preventSave: true,
},
],
});
示例9:
import { ArtifactTypePatterns } from 'core/artifact';
import { Registry } from 'core/registry';
import { WebhookTrigger } from './WebhookTrigger';
Registry.pipeline.registerTrigger({
component: WebhookTrigger,
description: 'Executes the pipeline when a webhook is received.',
excludedArtifactTypePatterns: [ArtifactTypePatterns.JENKINS_FILE],
key: 'webhook',
label: 'Webhook',
validators: [
{
type: 'serviceAccountAccess',
message: `You do not have access to the service account configured in this pipeline's webhook trigger.
You will not be able to save your edits to this pipeline.`,
preventSave: true,
},
],
});