-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-bitbucket-pipeline.yml
29 lines (24 loc) · 1.04 KB
/
example-bitbucket-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
definitions:
scripts:
sendNotification: &sendNotification |
python3 sendNotification.py \
--exitcode $BITBUCKET_EXIT_CODE --buildnumber $BITBUCKET_BUILD_NUMBER --branch $BITBUCKET_BRANCH \
--isbefore n\
sendNotificationBefore: &sendNotificationBefore |
export BITBUCKET_TRIGGERER_USERNAME=$(curl -X GET -g "https://api.bitbucket.org/2.0/users/${BITBUCKET_STEP_TRIGGERER_UUID}" | jq --raw-output '.display_name')
python3 sendNotification.py \
--exitcode $BITBUCKET_EXIT_CODE --buildnumber $BITBUCKET_BUILD_NUMBER --branch $BITBUCKET_BRANCH \
--isbefore y --user "$BITBUCKET_TRIGGERER_USERNAME" \
exampleDeploy: &exampleDeploy |
echo "Deploying Repository"
steps:
- step: &deployRepository
script:
- *sendNotificationBefore # Send notification that build is starting
- *exampleDeploy
after-script:
- *sendNotification # Send notification with build status
pipelines:
custom:
deploy-repository:
- step: *deployRepository