Skip to content

Commit

Permalink
feat(codebuild): Add help text to CodeBuild stage (#7948)
Browse files Browse the repository at this point in the history
* feat(codebuild): Add help text to CodeBuild stage

* Revise some help text

Co-authored-by: Clare Liguori <[email protected]>
  • Loading branch information
Kaixiang-AWS and clareliguori authored Feb 25, 2020
1 parent 7a9dae3 commit 2c7d602
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/scripts/modules/core/src/help/help.contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,13 @@ const helpContents: { [key: string]: string } = {
'pipeline.config.entitytags.value': `Value can either be a string or an object. If you want to use an object, input a valid JSON string.`,
'pipeline.config.entitytags.region': `(Optional) Target a specific region, use * if you want to apply to all regions.`,
'pipeline.config.deliveryConfig.manifest': `(Optional) Name of the file with your Delivery Config manifest. Leave blank to use the default name (<strong><i>${SETTINGS.managedDelivery?.defaultManifest}</i></strong>).`,
'pipeline.config.codebuild.source': `(Optional) Source of the build. It will be overrided to Spinnaker artifact if checked. If not checked, source configured in CodeBuild project will be used.`,
'pipeline.config.codebuild.sourceType': `(Optional) Type of the source. It can be specified explicitly, otherwise it will be inferred from source artifact.`,
'pipeline.config.codebuild.sourceVersion': `(Optional) Source version of the build. If not specified, the artifact version will be used. If artifact doesn't have a version, the latest version will be used. See the <a href="https://docs.aws.amazon.com/codebuild/latest/APIReference/API_StartBuild.html#CodeBuild-StartBuild-request-sourceVersion">CodeBuild reference</a> for more information.`,
'pipeline.config.codebuild.buildspec': `(Optional) Inline buildspec definition of the build. If not specified, buildspec configured in CodeBuild project will be used.`,
'pipeline.config.codebuild.secondarySources': `(Optional) Secondary sources of the build. It can be overrided by adding Spinnaker Artifacts. If not specified, secondary sources configured in CodeBuild project will be used.`,
'pipeline.config.codebuild.image': `(Optional) Image in which the build will run. It can be overrided by specifying the name of the image. If not specified, image configured in CodeBuild project will be used.`,
'pipeline.config.codebuild.envVar': `(Optional) Environment variables that will be propagated into the build.`,
};

Object.keys(helpContents).forEach(key => HelpContentsRegistry.register(key, helpContents[key]));
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { get } from 'lodash';

import {
FormikFormField,
HelpField,
IArtifact,
IExpectedArtifact,
IFormInputProps,
Expand Down Expand Up @@ -75,6 +76,7 @@ export function AwsCodeBuildStageForm(props: IAwsCodeBuildStageFormProps & IForm
<h4>Source Configuration</h4>
<FormikFormField
fastField={false}
help={<HelpField id="pipeline.config.codebuild.source" />}
label="Source"
name="source.sourceOverride"
input={(inputProps: IFormInputProps) => (
Expand All @@ -84,7 +86,8 @@ export function AwsCodeBuildStageForm(props: IAwsCodeBuildStageFormProps & IForm
{get(stage, 'source.sourceOverride') === true && (
<FormikFormField
fastField={false}
label="SourceType"
help={<HelpField id="pipeline.config.codebuild.sourceType" />}
label="Source Type"
name="source.sourceType"
input={(inputProps: IFormInputProps) => (
<ReactSelectInput {...inputProps} clearable={true} stringOptions={SOURCE_TYPES} />
Expand Down Expand Up @@ -118,12 +121,14 @@ export function AwsCodeBuildStageForm(props: IAwsCodeBuildStageFormProps & IForm
)}
<FormikFormField
fastField={false}
help={<HelpField id="pipeline.config.codebuild.sourceVersion" />}
label="Source Version"
name="source.sourceVersion"
input={(inputProps: IFormInputProps) => <TextInput {...inputProps} />}
/>
<FormikFormField
fastField={false}
help={<HelpField id="pipeline.config.codebuild.buildspec" />}
label="Buildspec"
name="source.buildspec"
input={(inputProps: IFormInputProps) => (
Expand All @@ -136,6 +141,7 @@ export function AwsCodeBuildStageForm(props: IAwsCodeBuildStageFormProps & IForm
/>
<FormikFormField
fastField={false}
help={<HelpField id="pipeline.config.codebuild.secondarySources" />}
label="Secondary Sources"
name="secondarySources"
input={(inputProps: IFormInputProps) => (
Expand All @@ -151,13 +157,15 @@ export function AwsCodeBuildStageForm(props: IAwsCodeBuildStageFormProps & IForm
<h4>Environment Configuration</h4>
<FormikFormField
fastField={false}
help={<HelpField id="pipeline.config.codebuild.image" />}
label="Image"
name="image"
input={(inputProps: IFormInputProps) => <TextInput {...inputProps} />}
/>
<h4>Advanced Configuration</h4>
<FormikFormField
fastField={false}
help={<HelpField id="pipeline.config.codebuild.envVar" />}
label="Environment Variables"
name="environmentVariables"
input={(inputProps: IFormInputProps) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Modal } from 'react-bootstrap';
import {
FormikFormField,
FormValidator,
HelpField,
IArtifact,
IExpectedArtifact,
IFormInputProps,
Expand Down Expand Up @@ -102,6 +103,7 @@ export class EditAwsCodeBuildSourceModal extends React.Component<IEditAwsCodeBui
</div>
<FormikFormField
fastField={false}
help={<HelpField id="pipeline.config.codebuild.sourceType" />}
label="Source Type"
name="type"
input={(inputProps: IFormInputProps) => (
Expand All @@ -110,6 +112,7 @@ export class EditAwsCodeBuildSourceModal extends React.Component<IEditAwsCodeBui
/>
<FormikFormField
fastField={false}
help={<HelpField id="pipeline.config.codebuild.sourceVersion" />}
label="Source Version"
name="sourceVersion"
input={(inputProps: IFormInputProps) => <TextInput {...inputProps} />}
Expand Down

0 comments on commit 2c7d602

Please sign in to comment.