本文整理汇总了TypeScript中core/registry.Registry.pipeline.registerArtifactKind方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Registry.pipeline.registerArtifactKind方法的具体用法?TypeScript Registry.pipeline.registerArtifactKind怎么用?TypeScript Registry.pipeline.registerArtifactKind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core/registry.Registry.pipeline
的用法示例。
在下文中一共展示了Registry.pipeline.registerArtifactKind方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: module
module(BASE64_ARTIFACT, []).config(() => {
Registry.pipeline.registerArtifactKind({
label: 'Base64',
type: 'embedded/base64',
description: 'An artifact that includes its referenced resource as part of its payload.',
key: 'base64',
isDefault: false,
isMatch: true,
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
this.artifact.type = 'embedded/base64';
},
controllerAs: 'ctrl',
editCmp: Base64ArtifactEditor,
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-2 sm-label-right">
Name
</label>
<div class="col-md-8">
<input type="text"
placeholder="base64-artifact"
class="form-control input-sm"
ng-model="ctrl.artifact.name" />
</div>
</div>
</div>
`,
});
});
示例2: module
module(BITBUCKET_ARTIFACT, []).config(() => {
Registry.pipeline.registerArtifactKind({
label: 'Bitbucket',
type: 'bitbucket/file',
description: 'A file stored in git, hosted by Bitbucket.',
key: 'bitbucket',
isDefault: false,
isMatch: true,
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
this.artifact.type = 'bitbucket/file';
},
controllerAs: 'ctrl',
editCmp: BitbucketArtifactEditor,
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-2 sm-label-right">
File path
<help-field key="pipeline.config.expectedArtifact.git.name"></help-field>
</label>
<div class="col-md-8">
<input type="text"
placeholder="manifests/frontend.yaml"
class="form-control input-sm"
ng-model="ctrl.artifact.name"/>
</div>
</div>
</div>
`,
});
});
示例3: module
module(S3_ARTIFACT, []).config(() => {
Registry.pipeline.registerArtifactKind({
label: 'S3',
type: 's3/object',
description: 'An S3 object.',
key: 's3',
isDefault: false,
isMatch: true,
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
this.artifact.type = 's3/object';
},
controllerAs: 'ctrl',
editCmp: S3ArtifactEditor,
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-2 sm-label-right">
Object path
<help-field key="pipeline.config.expectedArtifact.s3.name"></help-field>
</label>
<div class="col-md-8">
<input type="text"
placeholder="s3://bucket/path/to/file"
class="form-control input-sm"
ng-model="ctrl.artifact.name"/>
</div>
</div>
</div>
`,
});
});
示例4: module
module(DOCKER_ARTIFACT, []).config(() => {
Registry.pipeline.registerArtifactKind({
label: 'Docker',
type: 'docker/image',
isDefault: false,
isMatch: true,
// docker hub image artifacts can be bound to manifests without an associated artifact-account
isPubliclyAccessible: true,
description: 'A Docker image to be deployed.',
key: 'docker',
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
this.artifact.type = 'docker/image';
},
controllerAs: 'ctrl',
editCmp: DockerArtifactEditor,
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-2 sm-label-right">
Docker image
<help-field key="pipeline.config.expectedArtifact.docker.name"></help-field>
</label>
<div class="col-md-8">
<input type="text"
placeholder="gcr.io/project/image"
class="form-control input-sm"
ng-model="ctrl.artifact.name"/>
</div>
</div>
</div>
`,
});
});
示例5: module
module(DEFAULT_GITLAB_ARTIFACT, []).config(() => {
Registry.pipeline.registerArtifactKind({
label: 'Gitlab',
type: 'gitlab/file',
description: 'A file stored in git, hosted by Gitlab.',
key: 'default.gitlab',
isDefault: true,
isMatch: false,
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
this.artifact.type = 'gitlab/file';
const pathRegex = new RegExp('/api/v4/projects/[^/]*/[^/]*/repository/files/(.*)$');
this.onReferenceChange = () => {
const results = pathRegex.exec(this.artifact.reference);
if (results !== null) {
this.artifact.name = decodeURIComponent(results[1]);
}
};
},
controllerAs: 'ctrl',
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-3 sm-label-right">
Content URL
<help-field key="pipeline.config.expectedArtifact.defaultGitlab.reference"></help-field>
</label>
<div class="col-md-8">
<input type="text"
placeholder="https://gitlab.com/api/v4/projects/$ORG%2F$REPO/repository/files/path%2Fto%2Ffile.yml/raw"
class="form-control input-sm"
ng-change="ctrl.onReferenceChange()"
ng-model="ctrl.artifact.reference"/>
</div>
</div>
<div class="form-group row">
<label class="col-md-3 sm-label-right">
Commit/Branch
<help-field key="pipeline.config.expectedArtifact.defaultGitlab.version"></help-field>
</label>
<div class="col-md-3">
<input type="text"
placeholder="master"
class="form-control input-sm"
ng-model="ctrl.artifact.version"/>
</div>
</div>
</div>
`,
});
});
示例6: module
module(DEFAULT_S3_ARTIFACT, []).config(() => {
Registry.pipeline.registerArtifactKind({
label: 'S3',
type: 's3/object',
description: 'A S3 object.',
key: 'default.s3',
isDefault: true,
isMatch: false,
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
this.artifact.type = 's3/object';
this.onReferenceChange = () => {
const ref = this.artifact.reference;
if (isNil(ref)) {
return;
}
if (ref.indexOf('#') >= 0) {
const split = ref.split('#');
this.artifact.name = split[0];
this.artifact.version = split[1];
} else {
this.artifact.name = ref;
}
};
},
controllerAs: 'ctrl',
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-2 sm-label-right">
Object path
<help-field key="pipeline.config.expectedArtifact.defaultS3.reference"></help-field>
</label>
<div class="col-md-8">
<input type="text"
placeholder="s3://bucket/path/to/file"
class="form-control input-sm"
ng-change="ctrl.onReferenceChange()"
ng-model="ctrl.artifact.reference"/>
</div>
</div>
</div>
`,
});
});
示例7: module
module(DEFAULT_BITBUCKET_ARTIFACT, []).config(() => {
Registry.pipeline.registerArtifactKind({
label: 'Bitbucket',
type: 'bitbucket/file',
description: 'A file stored in git, hosted by Bitbucket.',
key: 'default.bitbucket',
isDefault: true,
isMatch: false,
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
this.artifact.type = 'bitbucket/file';
const pathRegex = new RegExp('/1.0/repositories/[^/]*/[^/]*/raw/[^/]*/(.*)$');
this.onReferenceChange = () => {
const results = pathRegex.exec(this.artifact.reference);
if (results !== null) {
this.artifact.name = decodeURIComponent(results[1]);
}
};
},
controllerAs: 'ctrl',
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-3 sm-label-right">
Content URL
<help-field key="pipeline.config.expectedArtifact.defaultBitbucket.reference"></help-field>
</label>
<div class="col-md-8">
<input type="text"
placeholder="https://api.bitbucket.org/1.0/repositories/$ORG/$REPO/raw/$VERSION/$FILEPATH"
class="form-control input-sm"
ng-change="ctrl.onReferenceChange()"
ng-model="ctrl.artifact.reference"/>
</div>
</div>
</div>
`,
});
});
示例8: module
module(DEFAULT_DOCKER_ARTIFACT, []).config(() => {
Registry.pipeline.registerArtifactKind({
label: 'Docker',
type: 'docker/image',
isDefault: true,
isMatch: false,
isPubliclyAccessible: true,
description: 'A Docker image to be deployed.',
key: 'default.docker',
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
this.artifact.type = 'docker/image';
this.onReferenceChange = () => {
setNameAndVersionFromReference(this.artifact);
};
},
controllerAs: 'ctrl',
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-2 sm-label-right">
Docker image
<help-field key="pipeline.config.expectedArtifact.defaultDocker.reference"></help-field>
</label>
<div class="col-md-8">
<input type="text"
placeholder="gcr.io/project/image@sha256:9efcc2818c9..."
class="form-control input-sm"
ng-change="ctrl.onReferenceChange()"
ng-model="ctrl.artifact.reference"/>
</div>
</div>
</div>
`,
});
});
示例9: function
.config(() => {
Registry.pipeline.registerArtifactKind({
label: 'Custom',
description: 'A custom-defined artifact.',
key: 'custom',
isDefault: true,
isMatch: true,
controller: function(artifact: IArtifact) {
'ngInject';
this.artifact = artifact;
},
controllerAs: 'ctrl',
editCmp: CustomArtifactEditor,
template: `
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-2 sm-label-right">
Type
</label>
<div class="col-md-3">
<input type="text"
class="form-control input-sm"
ng-model="ctrl.artifact.type"/>
</div>
<label class="col-md-2 sm-label-right">
Name
</label>
<div class="col-md-3">
<input type="text"
class="form-control input-sm"
ng-model="ctrl.artifact.name"/>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 sm-label-right">
Version
</label>
<div class="col-md-3">
<input type="text"
class="form-control input-sm"
ng-model="ctrl.artifact.version"/>
</div>
<label class="col-md-2 sm-label-right">
Location
</label>
<div class="col-md-3">
<input type="text"
class="form-control input-sm"
ng-model="ctrl.artifact.location"/>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 sm-label-right">
Reference
</label>
<div class="col-md-8">
<input type="text"
class="form-control input-sm"
ng-model="ctrl.artifact.reference"/>
</div>
</div>
</div>
`,
});
})
示例10:
kindConfigs.forEach(kindConfig => Registry.pipeline.registerArtifactKind(kindConfig));