Skip to content

Commit 01cba41

Browse files
committed
Line edits
1 parent 9cc4221 commit 01cba41

1 file changed

Lines changed: 24 additions & 22 deletions

File tree

README.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,26 @@ The directory structure of a step package project is shown below:
1414
* `\`
1515
* `steps` - A directory containing the step definitions.
1616
* `<step-name>` - A directory containing the definition of a step. There may be many of these directories to define many steps within a single step package.
17-
* `__tests__` - The directory containing step tests.
18-
* `executor.spec.ts` - Tests validating the logic in the `executor.ts` file.
19-
* `executor.ts` - The code to be executed when a step is run by Octopus.
20-
* `inputs.ts` - The definition of the inputs required by the step.
21-
* `logo.svg` - The image to be displayed in the Octopus web UI for the step.
22-
* `metadata.json` - The step metadata.
23-
* `ui.ts` - The step UI definition.
24-
* `validation.ts` - The step validation rules.
17+
* `src` - The parent directory containing the step code and assets.
18+
* `__tests__` - The directory containing step tests.
19+
* `executor.spec.ts` - Tests validating the logic in the `executor.ts` file.
20+
* `executor.ts` - The code to be executed when a step is run by Octopus.
21+
* `inputs.ts` - The definition of the inputs required by the step.
22+
* `logo.svg` - The image to be displayed in the Octopus web UI for the step.
23+
* `metadata.json` - The step metadata.
24+
* `ui.ts` - The step UI definition.
25+
* `validation.ts` - The step validation rules.
2526
* `targets`
2627
* `<target-name>`
27-
* `__tests__` - The directory containing step tests.
28-
* `executor.spec.ts` - Tests validating the logic in the `executor.ts` file.
29-
* `executor.ts` - The code to be executed when a target healthcheck is run by Octopus.
30-
* `inputs.ts` - The definition of the inputs required by the target.
31-
* `logo.svg` - The image to be displayed in the Octopus web UI for the target.
32-
* `metadata.json` - The target metadata.
33-
* `ui.ts` - The target UI definition.
34-
* `validation.ts` - The target validation rules.
28+
* `src` - The parent directory containing the step code and assets.
29+
* `__tests__` - The directory containing step tests.
30+
* `executor.spec.ts` - Tests validating the logic in the `executor.ts` file.
31+
* `executor.ts` - The code to be executed when a target healthcheck is run by Octopus.
32+
* `inputs.ts` - The definition of the inputs required by the target.
33+
* `logo.svg` - The image to be displayed in the Octopus web UI for the target.
34+
* `metadata.json` - The target metadata.
35+
* `ui.ts` - The target UI definition.
36+
* `validation.ts` - The target validation rules.
3537
* `.eslintignore` - The [ESLint ignore file](https://eslint.org/docs/user-guide/configuring/ignoring-code#the-eslintignore-file).
3638
* `.eslintrc.js` - The [ESLint configuration file](https://eslint.org/docs/user-guide/configuring/).
3739
* `.gitignore` - The [git ignore file](https://git-scm.com/docs/gitignore).
@@ -81,7 +83,7 @@ The `metadata.json` provides details about the target. A sample is shown below:
8183

8284
### `inputs.ts`
8385

84-
The `inputs.ts` file exports an interface defining the input fields required by the target. This interface is consumed by both `executor.ts` to read the values when performing the target's health check, and `ui.ts` to build up the form exposed in the Octopus web UI.
86+
The `inputs.ts` file exports an interface defining the input fields required by the target. This interface is consumed by `executor.ts` to read the values when performing the target's health check, `ui.ts` to build up the form exposed in the Octopus web UI, and `validate.ts` to verify new values.
8587

8688
An example is shown below exposing a single string field:
8789

@@ -93,7 +95,7 @@ export default interface HelloWorldTargetInputs {
9395

9496
### `executor.ts`
9597

96-
Targets perform a health check to validate their inputs and check the state of the system they represent. This health check is performed by the function exposed by the `executor.ts` file.
98+
Targets perform a health check to validate their inputs and check the state of the system they represent. This health check is performed by the function exported by the `executor.ts` file.
9799

98100
The example below prints some text to the log during a health check, and will always pass, meaning the target is always healthy:
99101

@@ -110,7 +112,7 @@ export default HelloWorldDeploymentTargetHealthCheckExecutor;
110112

111113
### `ui.ts`
112114

113-
The form to be exposed by the Octopus web UI is defined in the `ui.ts` file. The form is defined as an instance of the `DeploymentTargetUI` interface, which has two functions: `createInitialInputs` and `editInputsForm`.
115+
The form to be exposed by the Octopus web UI is defined by the function exported by the `ui.ts` file. The form is defined as an instance of the `DeploymentTargetUI` interface, which has two functions: `createInitialInputs` and `editInputsForm`.
114116

115117
The `createInitialInputs` function allows the initial default field values to be defined.
116118

@@ -147,11 +149,11 @@ export default HelloWorldTargetUI;
147149

148150
### `validation.ts`
149151

150-
Form validation is defined in the `validate.ts` file. This file exports a function the returns an array of `ValueValidator` objects, and takes two parameters:
152+
Form validation is performed by the function exported by the `validate.ts` file. This function the returns an array of `ValueValidator` objects, and takes two parameters:
151153
1. The step inputs as [input paths](https://github.com/OctopusDeploy/Architecture/blob/main/Steps/Concepts/InputsAndOutputs.md#input-paths).
152154
2. A validation function that returns a `ValueValidator` and takes two parameters:
153155
1. An input path.
154-
2. A function the returns a string containing the error code (or returns nothing if there is no validation error) and provides the input value as the first parameter.
156+
2. A function the returns a string containing the error code (or returns nothing if there is no validation error) and takes the input value (retrieved from the input path) as the first parameter.
155157

156158
Here is an example:
157159

@@ -249,7 +251,7 @@ export default HelloWorldStepExecutor;
249251

250252
### `ui.ts`
251253

252-
The step form to be displayed by the Octopus web UI is defined the same was it was with the target. There is one small difference though, where the first parameter to the `createInitialInputs` function can be an instance of `InitialInputFactories`, which provides the ability to create blank package references.
254+
The step form to be displayed by the Octopus web UI is defined much the same was it was with the target. There are some subtle differences though: it implements the `StepUI` type, and first parameter to the `createInitialInputs` function can be an instance of `InitialInputFactories`, which provides the ability to create blank package references.
253255

254256
Here we define the initial value of the `name` input to be a blank string, and build the form with a single `text` input:
255257

0 commit comments

Comments
 (0)