-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove documentation of old implementation
- Loading branch information
1 parent
f84ecea
commit 0b25158
Showing
3 changed files
with
36 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |