-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.yml
23 lines (22 loc) · 1023 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version: 0.2
env:
shell: bash
secrets-manager:
SLACK_WEBHOOKURL: "slack:k12stream"
phases:
build:
commands:
- pip install git+https://github.com/openstax/raise-mbtools@588d63f
- find files/. -name *.mp4 -print0 | xargs --null rm -f
- copy-resources-s3 ./files/ "$CONTENT_S3_BUCKET" contents/raise/resources https://k12.openstax.org/contents/raise/resources resources.html
- aws s3 cp --cache-control no-cache resources.html "s3://$CONTENT_S3_BUCKET/contents/raise/resources.html"
on-failure: ABORT
finally:
- "if [[ $CODEBUILD_BUILD_SUCCEEDING != 1 ]]; then curl -X POST -H 'Content-type: application/json' --data '{\"text\":\"Error in k12-media-raise pipeline!\"}' $SLACK_WEBHOOKURL; fi"
post_build:
commands:
- export SLACK_MESSAGE="k12-media-raise deployment completed for commit $COMMIT_ID"
- "curl -X POST -H 'Content-type: application/json' --data '{\"text\":\"'\"$SLACK_MESSAGE\"'\"}' $SLACK_WEBHOOKURL"
artifacts:
files:
- resources.html