-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
129 lines (125 loc) · 4.94 KB
/
bitbucket-pipelines.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# bitbucket-pipelines.yml
# Invokes lambdas to set the firmware version release hashes in the database.
# Uploads the deployed firmware files to the S3 bucket the service-resources portal uses.
# Invalidates the service-resources cloudfront distribution firmware path to force new firmware to be only version available for service-resources portal users.
image: atlassian/pipelines-awscli
pipelines:
branches:
master:
- step:
name: "Tag release"
condition:
changesets:
includePaths:
# any changes in docs section
- resources/docs/HTML5SideNav/**
script:
- todays_date=$(date '+%Y-%m-%d');
- release_string=${todays_date}_${BITBUCKET_BUILD_NUMBER}
- git tag release-${release_string} ${BITBUCKET_COMMIT}
- git push origin --tags
- step:
name: Prepare files for upload to S3
condition:
changesets:
includePaths:
# any changes in docs section
- resources/docs/HTML5SideNav/**
script:
- mkdir -p upload/docs
- cp -a resources/docs/HTML5SideNav/. upload/docs
artifacts:
- upload/**
- step:
name: Deploy to S3 and Invalidate CloudFront Deployment
condition:
changesets:
includePaths:
# any changes in docs section
- resources/docs/HTML5SideNav/**
deployment: Production
script:
- pipe: atlassian/aws-s3-deploy:0.5.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: us-east-1
S3_BUCKET: serverlessrepo-service-resources-prod-s3bucket-1kwxaz8etn3ek
LOCAL_PATH: upload
- pipe: atlassian/aws-cloudfront-invalidate:0.5.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: us-east-1
DISTRIBUTION_ID: EEPF0HOQ3ZELC
PATHS: /docs/*
- step:
name: Send Email Notification
condition:
changesets:
includePaths:
# any changes in docs section
- resources/docs/HTML5SideNav/**
script:
- pipe: atlassian/email-notify:0.4.4
variables:
USERNAME: $SES_SMTP_USERNAME
PASSWORD: $SES_SMTP_PASSWORD
FROM: [email protected]
SUBJECT: Service Resources - Docs Release
HOST: email-smtp.us-west-2.amazonaws.com
BODY_HTML: email_templates/email_body_prod.html
dev:
- step:
name: Prepare files for upload to S3
condition:
changesets:
includePaths:
# any changes in docs section
- resources/docs/HTML5SideNav/**
script:
- mkdir -p upload/docs
- cp -a resources/docs/HTML5SideNav/. upload/docs
artifacts:
- upload/**
- step:
name: Deploy to S3 and Invalidate CloudFront Deployment
condition:
changesets:
includePaths:
# any changes in docs section
- resources/docs/HTML5SideNav/**
deployment: Production
script:
- pipe: atlassian/aws-s3-deploy:0.5.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: us-east-1
S3_BUCKET: serverlessrepo-service-resources-dev-s3bucket-1qn54ce79estn
LOCAL_PATH: upload
- pipe: atlassian/aws-cloudfront-invalidate:0.5.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: us-east-1
DISTRIBUTION_ID: E1F1X2MTNLRZLM
PATHS: /docs/*
- step:
name: Send Email Notification
condition:
changesets:
includePaths:
# any changes in docs section
- resources/docs/HTML5SideNav/**
script:
- pipe: atlassian/email-notify:0.4.4
variables:
USERNAME: $SES_SMTP_USERNAME
PASSWORD: $SES_SMTP_PASSWORD
FROM: [email protected]
SUBJECT: Service Resources Dev - Docs Release for Approval
HOST: email-smtp.us-west-2.amazonaws.com
BODY_HTML: email_templates/email_body_dev.html