Repository navigation
Expand file tree
/
Copy pathbuildspec.yml
More file actions
44 lines (35 loc) · 1.85 KB
/
Copy pathbuildspec.yml
File metadata and controls
44 lines (35 loc) · 1.85 KB
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
version: 0.2
phases:
install:
commands:
- apt -y update
- apt -y install awscli texlive-full
build:
commands:
- pdflatex -output-directory static resume/resume.tex
post_build:
commands:
# get s3 bucket name
- aws cloudformation describe-stacks --stack-name weblog --query 'Stacks[0].Outputs[?OutputKey==`Bucket`].OutputValue' --output text > bucket
# copy files to s3 bucket
- aws s3 cp static/error.html s3://$(cat bucket) --cache-control max-age=31536000 --content-type text/html
- aws s3 cp static/favicon.ico s3://$(cat bucket) --cache-control max-age=31536000 --content-type image/png
- aws s3 cp static/index.html s3://$(cat bucket) --cache-control max-age=31536000 --content-type text/html
- aws s3 cp static/resume.pdf s3://$(cat bucket) --cache-control max-age=31536000 --content-type application/pdf
- aws s3 cp static/robots.txt s3://$(cat bucket) --cache-control max-age=31536000 --content-type text/plain
- aws s3 cp static/soundboard.html s3://$(cat bucket) --cache-control max-age=31536000 --content-type text/html
- aws s3 cp static/soundboard.js s3://$(cat bucket) --cache-control max-age=31536000 --content-type application/javascript
# get cloudfront distribution id
- aws cloudformation describe-stacks --stack-name weblog --query 'Stacks[0].Outputs[?OutputKey==`Distribution`].OutputValue' --output text > distribution
# create cloudfront invalidation
- aws cloudfront create-invalidation --distribution-id $(cat distribution) --paths / /error.html /favicon.ico /index.html /resume.pdf /robots.txt /soundboard.html /soundboard.js
artifacts:
discard-paths: yes
files:
- static/error.html
- static/favicon.ico
- static/index.html
- static/resume.pdf
- static/robots.txt
- static/soundboard.html
- static/soundboard.js