-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
33 lines (31 loc) · 1.38 KB
/
buildspec.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
version: 0.2
env:
variables:
BUCKET_NAME: org.dltj.blog
DISTRIBUTION_ID: E36WY2W5966KTS
phases:
install:
commands:
- TOKEN=$(curl http://169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI)
- echo $TOKEN
- export AWS_ACCESS_KEY_ID=$(echo "${TOKEN}" | jq -r '.AccessKeyId')
- export AWS_SECRET_ACCESS_KEY=$(echo "${TOKEN}" | jq -r '.SecretAccessKey')
- export AWS_SESSION_TOKEN=$(echo "${TOKEN}" | jq -r '.Token')
pre_build:
commands:
- aws s3 cp s3://org.dltj.webmentions-cache webmentions-cache --recursive
- export LC_ALL="C.UTF-8"
- export LANG="en_US.UTF-8"
- export LANGUAGE="en_US.UTF-8"
build:
commands:
- ls -la
- pdm install --prod
- pdm run pelican content -o output -s publishconf.py -t /app/pelican-themes/pelican-papyrus-theme
post_build:
commands:
- aws s3 cp webmentions-cache s3://org.dltj.webmentions-cache --recursive
- cp ./assets/js/JekyllWebmentionIO.js output/assets/js/JekyllWebmentionIO.js
# - aws s3 sync --delete --size-only --cache-control max-age=7201 _site/ "s3://${BUCKET_NAME}"
- s3deploy -bucket org.dltj.blog -region us-east-1 -source output/ -distribution-id ${DISTRIBUTION_ID} -key $AWS_ACCESS_KEY_ID -secret $AWS_SECRET_ACCESS_KEY
- aws s3api put-bucket-website --bucket "${BUCKET_NAME}" --website-configuration file://s3-website-config.json