Skip to content

Commit

Permalink
Remove documentation of old implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrogattuso committed Mar 5, 2021
1 parent f84ecea commit 0b25158
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 83 deletions.
2 changes: 1 addition & 1 deletion docs/data/step-types-versions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Data Source: codefresh_step_types_versions
This data source allows to retrieve the latest published version of a step-types
This data source allows to retrieve the list of published versions of a step-types

## Example Usage

Expand Down
50 changes: 0 additions & 50 deletions docs/resources/step-types-versions.md

This file was deleted.

67 changes: 35 additions & 32 deletions docs/resources/step-types.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
# Step-type Resource
# Step-types Resource

The Step-type resource allows to create your own typed step.
The Step-types resource allows to create your own typed step and manage all it's published versions.
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.
More about custom steps in the [official documentation](https://codefresh.io/docs/docs/codefresh-yaml/steps/#creating-a-typed-codefresh-plugin).

## Known limitations and disclaimers
### Differences during plan phase
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`.
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.
### Version and name in yaml Metadata are ignored.
The version and name of the step declared in the yaml files are superseeded by the attributes specified at resource level:
- `name` : at top level
- `version_numer`: specified in the `version` block
The above are added/replaced at runtime time.

### Number of API requests
This resource makes a lot of additional API calls to validate the steps and retrieve all the version available.
Caution is recommended on the amount of versions maintained and the number of resources defined in a single project.

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

## Example Usage

```hcl
resource "codefresh_step_types" "custom_step" {
# NOTE: you can also load the yaml from a file with `step_types_yaml = file("PATH-TO-FILE.yaml")`
# Example has been cut down for simplicity. Yaml schema must be compliant with the what specified in the documentation for typed plugins
step_types_yaml = <<YAML
version: '1.0'
kind: step-type
metadata:
name: <ACCOUNT_NAME>/custom-step
...
spec:
arguments: |-
{
....
}
delimiters:
left: '[['
right: ']]'
stepsTemplate: |-
print_info_message:
name: Test step
...
YAML
data "codefresh_current_account" "acc" {
}
resource "codefresh_step_types_versions" "my-custom-step" {
name = "${data.codefresh_current_account.acc.name}/my-custom-step"
version {
version_number = "0.0.1"
step_types_yaml = file("./templates/plugin-0.0.1.yaml")
}
version {
version_number = "0.0.2"
step_types_yaml = file("./templates/plugin-0.0.2.yaml")
}
....
}
}
```

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

- `step_types_yaml` (Required) YAML String containing a valid definition of a typed plugin

---

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

0 comments on commit 0b25158

Please sign in to comment.