Concourse: basic support for 'do' attribute

This commit is contained in:
Kris De Volder
2016-12-21 13:57:49 -08:00
parent 50cc31f149
commit 5e37be88ae
3 changed files with 37 additions and 2 deletions

View File

@@ -120,15 +120,18 @@ public class PipelineYmlSchema implements YamlSchema {
prop(taskStep, "output_mapping", t_string_params);
YBeanType aggregateStep = f.ybean("AggregateStep");
YBeanType doStep = f.ybean("DoStep");
YBeanType[] stepTypes = {
getStep,
putStep,
taskStep,
aggregateStep
aggregateStep,
doStep
};
YBeanUnionType step = f.yunion("Step", stepTypes);
prop(aggregateStep, "aggregate", f.yseq(step));
prop(doStep, "do", f.yseq(step));
// shared properties applicable for any type of Step:
prop(step, "on_success", step);

View File

@@ -0,0 +1,14 @@
Run steps in series.
do: [step]
Simply performs the given steps serially, with the same semantics as if they were at the top level step listing.
This can be used to perform multiple steps serially in the branch of an `aggregate` step:
plan:
- aggregate:
- task: unit
- do:
- get: something-else
- task: something-else-unit

View File

@@ -135,6 +135,9 @@ public class PipelineYamlEditorTest {
"aggregate:\n" +
" - <*>"
, // ==============
"do:\n" +
" - <*>"
, // ==============
"get: <*>"
, // ==============
"put: <*>"
@@ -261,7 +264,22 @@ public class PipelineYamlEditorTest {
editor.assertHoverContains("aggregate", "Performs the given steps in parallel");
}
@Test
public void doStepHovers() throws Exception {
Editor editor;
editor = harness.newEditor(
"jobs:\n" +
"- name: some-job\n" +
" plan:\n" +
" - do:\n" +
" - get: some-resource\n"
);
editor.assertHoverContains("do", "performs the given steps serially");
}
@Test
public void reconcileSimpleTypes() throws Exception {
Editor editor;