mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
40 lines
1.3 KiB
Django/Jinja
40 lines
1.3 KiB
Django/Jinja
---
|
|
|
|
image: debian:buster
|
|
options:
|
|
size: 2x
|
|
|
|
definitions:
|
|
services:
|
|
docker:
|
|
memory: 4096
|
|
|
|
pipelines:
|
|
default:
|
|
- step:
|
|
name: Pre Parallelization stage
|
|
script:
|
|
- echo "Running tests in {{ parallel_steps|length }} batches"
|
|
- step:
|
|
name: Check if number of batches match actual number of scenarios
|
|
script:
|
|
- |
|
|
actual_scenario_count=$(find ./roles -type f -name "molecule.yml" -exec dirname {} ';' | wc -l | sed -e 's/^[[:space:]]*//')
|
|
grep "Running tests in ${actual_scenario_count} batches" bitbucket-pipelines.yml
|
|
GREP_RETURN_CODE=$?
|
|
if [[ $GREP_RETURN_CODE -ne 0 ]]; then
|
|
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 -%}
|
|
- step:
|
|
name: {{ parallel_step.name }}
|
|
services:
|
|
- docker
|
|
script:
|
|
{% for scriptCommand in parallel_step.scriptCommands -%}
|
|
- {{ scriptCommand }}
|
|
{% endfor %}
|
|
{% endfor %}
|