DCD-1205: Simplify the pipelines generator.

This commit is contained in:
Steve
2021-01-20 12:55:50 +11:00
parent ad661add8f
commit c250da08ed
3 changed files with 140 additions and 168 deletions

View File

@@ -18,9 +18,10 @@ pipelines:
- step:
name: Pre Parallelization stage
script:
- echo "Running tests in {{ parallel_steps|length }} batches"
- echo "Running tests in {{ scenario_paths|length }} batches"
- step:
name: Check if number of batches match actual number of scenarios
name: Check if the template is up-to-date
script:
- |
actual_scenario_count=$(find ./roles -type f -name "molecule.yml" -exec dirname {} ';' | wc -l | sed -e 's/^[[:space:]]*//')
@@ -30,14 +31,15 @@ pipelines:
echo "Mismatch between expected and actual number [${actual_scenario_count}] of scenarios. Please look at https://bitbucket.org/atlassian/dc-deployments-automation/src/master/DEVELOPMENT.md for instructions on how to fix this error."
exit $GREP_RETURN_CODE
fi
- parallel:
{% for parallel_step in parallel_steps -%}
{% for spath in scenario_paths -%}
- step:
name: {{ parallel_step.name }}
name: {{ spath.parts[2] }}/{{ spath.parts[4] }}
services:
- docker
script:
{% for scriptCommand in parallel_step.scriptCommands -%}
- {{ scriptCommand }}
{% endfor %}
- ./bin/install-ansible --dev
- cd roles/{{ spath.parts[2] }}
- molecule test -s {{ spath.parts[4] }}
{% endfor %}