You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-19Lines changed: 22 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,18 @@ Step packages are an evolution in the development of Octopus steps. Step package
2
2
3
3
* Developed outside the main Octopus code base.
4
4
* Tested as isolated and independent projects.
5
-
* Distributed on their own independent timelines.
6
-
* Independently versioned, with each version able to be run side-by-side.
5
+
* Distributed on their own independent timelines (not quite implemented yet).
6
+
* Independently versioned, with each version able to be run side-by-side (not implemented yet).
7
7
8
-
This sample project provides a starting point for anyone looking to create a new step package. The code in this repository defines a "Hello World" target and step to demonstrate a minimal step package implementation.
8
+
This sample project provides a starting point for anyone looking to create a new step package. The code in this repository defines a "Hello World" target and step demonstrating a minimal step package implementation.
9
9
10
10
## Project directory structure
11
11
12
-
The directory structure of a step package project is shown below:
12
+
The directory structure of a step package is shown below:
13
13
14
14
*`\`
15
-
*`steps` - A directory containing the step definitions.
16
-
*`<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.
15
+
*`steps` - A directory containing one or more step definitions.
16
+
*`<step-name>` - A directory containing the definition of a step. There may be many of these directories defining many steps within a single step package.
17
17
*`src` - The parent directory containing the step code and assets.
18
18
*`__tests__` - The directory containing step tests.
19
19
*`executor.spec.ts` - Tests validating the logic in the `executor.ts` file.
@@ -23,12 +23,12 @@ The directory structure of a step package project is shown below:
23
23
*`metadata.json` - The step metadata.
24
24
*`ui.ts` - The step UI definition.
25
25
*`validation.ts` - The step validation rules.
26
-
*`targets`
27
-
*`<target-name>`
28
-
*`src` - The parent directory containing the step code and assets.
29
-
*`__tests__` - The directory containing step tests.
26
+
*`targets` - A directory containing one or more target definitions.
27
+
*`<target-name>` - A directory containing the definition of a target. There may be many of these directories defining many steps within a single step package.
28
+
*`src` - The parent directory containing the target code and assets.
29
+
*`__tests__` - The directory containing target tests.
30
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.
31
+
*`executor.ts` - The code to be executed when a target health check is run by Octopus.
32
32
*`inputs.ts` - The definition of the inputs required by the target.
33
33
*`logo.svg` - The image to be displayed in the Octopus web UI for the target.
34
34
*`metadata.json` - The target metadata.
@@ -55,7 +55,7 @@ Creating a new target involves creating the following files under the `steps/<ta
55
55
56
56
### `metadata.json`
57
57
58
-
The `metadata.json` provides details about the target. A sample is shown below:
58
+
The `metadata.json`file provides details about the target. A sample is shown below:
59
59
60
60
```json
61
61
{
@@ -74,11 +74,11 @@ The `metadata.json` provides details about the target. A sample is shown below:
74
74
75
75
*`schemaVersion` is the version of the metadata file. `1.0.0` is the only version available.
76
76
*`version` is the version of the target. Versioning is covered in detail [here](https://github.com/OctopusDeploy/Architecture/blob/main/Steps/Concepts/Versioning.md).
77
-
*`type` defines the type of resource tobe created. It must be `deployment-target` for a target.
77
+
*`type` defines the type of resource to be created. It must be `deployment-target` for a target.
78
78
*`id` is the resource ID.
79
79
*`name` is the name of the target displayed by the Octopus web UI.
80
80
*`description` is the description of the target displayed by the Octopus UI.
81
-
*`categories` is an array containing one or more step categories display by the Octopus UI where the target will be listed.
81
+
*`categories` is an array containing one or more target categories display by the Octopus UI where the target will be listed.
82
82
*`launcher` defines how the step is executed. A value of `node` means the step is executed by Node.js.
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`.
115
+
The form displayed 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`.
116
116
117
117
The `createInitialInputs` function allows the initial default field values to be defined.
118
118
119
-
The `editInputsForm` function provides a DSL for building the user interface. The first parameter is the inputs defined in `inputs.ts`. The second parameter is an instance of `AvailableStepComponents`, which has factory functions for creating various input widgets like text fields, lists, radio buttons etc.
119
+
The `editInputsForm` function provides a DSL for building the user interface. The first parameter is the inputs defined in `inputs.ts`. The second parameter is an instance of `AvailableDeploymentTargetComponents`, which has factory functions for creating various input widgets like text fields, lists, radio buttons etc.
120
120
121
121
Here we define the initial value of the `greetingPrefix` input to be `Hello`, and build the form with a single `text` input:
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:
152
+
Form validation is performed by the function exported by the `validate.ts` file. This function returns an array of `ValueValidator` objects, and takes two parameters:
153
153
1. The step inputs as [input paths](https://github.com/OctopusDeploy/Architecture/blob/main/Steps/Concepts/InputsAndOutputs.md#input-paths).
154
154
2. A validation function that returns a `ValueValidator` and takes two parameters:
155
155
1. An input path.
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.
156
+
2. A function returning 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.
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.
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:
255
+
* It implements the `StepUI` type.
256
+
* The first parameter to the `createInitialInputs` function can be an instance of `InitialInputFactories`, which provides the ability to create blank package references.
257
+
* The second parameter to the `editInputsForm` function is an instance of `AvailableStepComponents`, which exposes a different widget set.
255
258
256
259
Here we define the initial value of the `name` input to be a blank string, and build the form with a single `text` input:
0 commit comments