Files
dc-deployments-automation/bitbucket-pipelines.yml
Varun Arbatti 522706467e Merged in DCD-621-parallelize-builds (pull request #20)
DCD-621 parallelize builds

* DCD-621: Parallelizes tests ny invoking the parralelize script

* DCD-621: Removes leading / to start jira command in product_startup role

* DCD-621: Runs a scenario by name instead of using the all parameter

* DCD-621: A better find all scenarios function to ensure we look at relevant molecule scenarios. Better logging too

* DCD-510: Parallelizes tests further, running in 26 batches on 1 each. The pipeline file is now generated using Jinja

* DCD-510: Adds a pre check stage to verify if number of batches match actual number of scenarios. This test will fail (deliberately)

* DCD-510: Adds a pre check stage to verify if number of batches match actual number of scenarios. Fixes 'test' failure

* DCD-590: Adds note to development.md on how to generate a pipeline file. Adds a makefile and updates a few script commands

* DCD-590: Better documentation in development README document. Updates YML with instructions on how to fix issues with the prevalidation stage

Approved-by: Steve Smith <ssmith@atlassian.com>
Approved-by: Ben Partridge <bpartridge@atlassian.com>
2019-08-30 06:22:53 +00:00

265 lines
8.3 KiB
YAML

---
image: atlassian/default-image:2
options:
size: 2x
definitions:
services:
docker:
memory: 4096
pipelines:
default:
- step:
name: Pre Parallelization stage
script:
- echo "Running tests in 26 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:
- step:
name: Molecule Test Batch 1
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 1
- step:
name: Molecule Test Batch 2
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 2
- step:
name: Molecule Test Batch 3
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 3
- step:
name: Molecule Test Batch 4
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 4
- step:
name: Molecule Test Batch 5
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 5
- step:
name: Molecule Test Batch 6
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 6
- step:
name: Molecule Test Batch 7
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 7
- step:
name: Molecule Test Batch 8
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 8
- step:
name: Molecule Test Batch 9
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 9
- step:
name: Molecule Test Batch 10
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 10
- step:
name: Molecule Test Batch 11
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 11
- step:
name: Molecule Test Batch 12
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 12
- step:
name: Molecule Test Batch 13
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 13
- step:
name: Molecule Test Batch 14
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 14
- step:
name: Molecule Test Batch 15
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 15
- step:
name: Molecule Test Batch 16
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 16
- step:
name: Molecule Test Batch 17
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 17
- step:
name: Molecule Test Batch 18
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 18
- step:
name: Molecule Test Batch 19
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 19
- step:
name: Molecule Test Batch 20
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 20
- step:
name: Molecule Test Batch 21
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 21
- step:
name: Molecule Test Batch 22
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 22
- step:
name: Molecule Test Batch 23
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 23
- step:
name: Molecule Test Batch 24
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 24
- step:
name: Molecule Test Batch 25
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 25
- step:
name: Molecule Test Batch 26
services:
- docker
script:
- apt-get update && apt-get install -y virtualenv python-dev
- ./bin/install-ansible
- ./bin/run-tests-in-batches --batch 26