version: 0.2 phases: install: commands: - pip install "tox < 4.0" runtime-versions: python: latest pre_build: commands: - git clone https://github.com/aws-samples/busy-engineers-document-bucket.git - cd busy-engineers-document-bucket/exercises/python/encryption-context-complete - sed -i "s/aws_encryption_sdk/aws_encryption_sdk==$VERSION/" requirements-dev.txt - pyenv install 3.8.12 - pyenv local 3.8.12 - pip install "tox < 4.0" build: commands: - NUM_RETRIES=3 - | while [ $NUM_RETRIES -gt 0 ] do tox -re test if [ $? -eq 0 ]; then break fi NUM_RETRIES=$((NUM_RETRIES-1)) if [ $NUM_RETRIES -eq 0 ]; then echo "All validation attempts failed, stopping" exit 1; else echo "Validation failed, retrying in 60 seconds; will retry $NUM_RETRIES more times" && sleep 60 fi done