Skip to content

Commit 0b25158

Browse files
committed
Remove documentation of old implementation
1 parent f84ecea commit 0b25158

File tree

3 files changed

+36
-83
lines changed

3 files changed

+36
-83
lines changed

docs/data/step-types-versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Data Source: codefresh_step_types_versions
2-
This data source allows to retrieve the latest published version of a step-types
2+
This data source allows to retrieve the list of published versions of a step-types
33

44
## Example Usage
55

docs/resources/step-types-versions.md

Lines changed: 0 additions & 50 deletions
This file was deleted.

docs/resources/step-types.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,50 @@
1-
# Step-type Resource
1+
# Step-types Resource
22

3-
The Step-type resource allows to create your own typed step.
3+
The Step-types resource allows to create your own typed step and manage all it's published versions.
4+
The resource allows to handle the life-cycle of the version by allowing specifying multiple blocks `version` where the user provides a version number and the yaml file representing the plugin.
45
More about custom steps in the [official documentation](https://codefresh.io/docs/docs/codefresh-yaml/steps/#creating-a-typed-codefresh-plugin).
56

67
## Known limitations and disclaimers
7-
### Differences during plan phase
8-
When executing `terraform plan` the diff presented will be the comparison between the latest published version and the version configured in the `step_types_yaml`.
9-
At this stage the Read function doesn't have the reference to the new version in order to be able to retrieve the exact version for comparison.
8+
### Version and name in yaml Metadata are ignored.
9+
The version and name of the step declared in the yaml files are superseeded by the attributes specified at resource level:
10+
- `name` : at top level
11+
- `version_numer`: specified in the `version` block
12+
The above are added/replaced at runtime time.
13+
14+
### Number of API requests
15+
This resource makes a lot of additional API calls to validate the steps and retrieve all the version available.
16+
Caution is recommended on the amount of versions maintained and the number of resources defined in a single project.
1017

11-
### Deletion of resource
12-
When executing `terraform destroy` the step-stype is completely removed (including all the existing version)
1318

1419
## Example Usage
1520

1621
```hcl
17-
resource "codefresh_step_types" "custom_step" {
18-
19-
# NOTE: you can also load the yaml from a file with `step_types_yaml = file("PATH-TO-FILE.yaml")`
20-
# Example has been cut down for simplicity. Yaml schema must be compliant with the what specified in the documentation for typed plugins
21-
step_types_yaml = <<YAML
22-
version: '1.0'
23-
kind: step-type
24-
metadata:
25-
name: <ACCOUNT_NAME>/custom-step
26-
...
27-
spec:
28-
arguments: |-
29-
{
30-
....
31-
}
32-
delimiters:
33-
left: '[['
34-
right: ']]'
35-
stepsTemplate: |-
36-
print_info_message:
37-
name: Test step
38-
...
39-
YAML
22+
23+
data "codefresh_current_account" "acc" {
24+
}
25+
26+
resource "codefresh_step_types_versions" "my-custom-step" {
27+
name = "${data.codefresh_current_account.acc.name}/my-custom-step"
28+
29+
version {
30+
version_number = "0.0.1"
31+
step_types_yaml = file("./templates/plugin-0.0.1.yaml")
32+
}
33+
version {
34+
version_number = "0.0.2"
35+
step_types_yaml = file("./templates/plugin-0.0.2.yaml")
36+
}
37+
....
38+
}
4039
}
4140
```
4241

4342
## Argument Reference
43+
- `name` - (Required) The name for the step-type
44+
- `version` - (At least 1 Required) A collection of `version` blocks as documented below.
4445

45-
- `step_types_yaml` (Required) YAML String containing a valid definition of a typed plugin
46-
46+
---
4747

48+
`version` supports the following:
49+
- `version_number` - (Required) String representing the semVer for the step
50+
- `step_types_yaml` (Required) YAML String containing a valid definition of a typed plugin

0 commit comments

Comments
 (0)