Add old_name property to Resource schema

See: https://github.com/spring-projects/sts4/issues/633
This commit is contained in:
Kris De Volder
2021-05-05 10:46:10 -07:00
parent 0b840cd8ea
commit f825c2e797
3 changed files with 25 additions and 0 deletions

View File

@@ -238,6 +238,7 @@ public class PipelineYmlSchema implements YamlSchema {
addProp(t_resource, "tags", t_strings);
addProp(t_resource, "webhook_token", t_ne_string);
addProp(t_resource, "icon", t_ne_string);
addProp(t_resource, "old_name", t_ne_string);
AbstractType t_image_resource = f.ybean("ImageResource");
{

View File

@@ -0,0 +1,20 @@
*Optional* The old name of the resource. If configured, the history of the old resource will be inherited to the new one. Once the pipeline is set, this field can be removed as the history has been transferred.
This can be used to rename a resource without losing its history, like so:
```
resources:
- name: new-name
old_name: current-name
type: git
source: uri: "https://github.com/vito/booklit"
```
After the pipeline is set, the resource was successfully renamed, so the `old_name` field can be removed from the resource:
```
resources:
- name: new-name
type: git
source: uri: "https://github.com/vito/booklit"
```