i have written a yml for that just configured ec2 details after that i need to send an email to developers that depolyment is done with the status failed r sucess.
image: atlassian/default-image:3
pipelines:
default:
- parallel:
- step:
name: 'Build and Test'
script:
- echo "Your build and test goes here.."
- step:
name: 'Lint'
script:
- echo "Your linting goes here..."
- step:
name: 'Security scan'
script:
- echo "Your security scan goes here..."
# The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- pipe: atlassian/ssh-run:0.4.0
variables :
SSH_USER: '******'
SERVER: '*************'
COMMAND: 'mkdir test21'
- step :
name: 'email notifications'
script:
- ALERT_TYPE="success"
- if [[ $BITBUCKET_EXIT_CODE -ne 0 ]]; then ALERT_TYPE="error" ; fi
- pipe: 'atlassian/email-notify:0.5.0'
variables :
USERNAME: '$SOME_USERNAME'
PASSWORD: $PASSWORD
FROM: 'noreply@atlassian.com'
TO: '$SOME_EMAIL_TO'
HOST: 'smtp.gmail.com'
PORT: '25'
SUBJECT: '${ALERT_TYPE}:Bitbucket Pipe Notification for ${BITBUCKET_BRANCH}'