script:
- pip install pytest
# - pip install pytest-html
- pytest -v -s test.py --junitxml=./test-reports/report.xml
after-script:
- apt-get update && apt-get install -y zip
- zip -r test-reports.zip test-reports
- ALERT_TYPE="SUCCESS"
- if [[ $BITBUCKET_EXIT_CODE -ne 0 ]]; then ALERT_TYPE="FAILURE" ; fi
- pipe: atlassian/email-notify:0.8.0
variables:
USERNAME: 'satishk@gmail.com'
PASSWORD: ${PASSWORD}
FROM: 'satishk@gmail.com'
TO: 'dj.duraj@gmail.com'
HOST: 'smtp-mail.outlook.com'
PORT: 587
DEBUG: 'true'
SUBJECT: '${ALERT_TYPE}:Bitbucket Pipe Notification for ${BITBUCKET_BRANCH} branch of ${BITBUCKET_WORKSPACE}'
BODY_PLAIN: 'Hello Team,<br>
Please Find the attachement of <b>${ALERT_TYPE}</b> report of current pipeline status.'
ATTACHMENTS: 'test-reports.zip'