Skip to content

Commit d1ec1fb

Browse files
committed
try to invalidate cf
1 parent 2b4e80e commit d1ec1fb

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ deploy:
3535
detect_encoding: true
3636
on:
3737
branch: master
38+
after_deploy:
39+
- AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY python cloudfront_invalidate.py

.travis/invalidate_cloudfront.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import boto3
2+
3+
client = boto3.client('cloudfront')
4+
5+
response = client.create_invalidation(
6+
DistributionId='EL6HA8RZFI08I',
7+
InvalidationBatch={
8+
'Paths': {
9+
'Quantity': 1,
10+
'Items': [
11+
'/index.html',
12+
]
13+
},
14+
'CallerReference': 'string'
15+
}
16+
)
17+
print(response)

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@ dev_environment:
3030
conda env update
3131
source activate pythonplot && pip install -r requirements.txt
3232

33-
.PHONY: all render s3_upload run_nb travis clean invalidate_cache
33+
cloudfront_invalidate:
34+
python .travis/invalidate_cloudfront.py
35+
36+
.PHONY: all render s3_upload run_nb travis clean invalidate_cache cloudfront_invalidate

0 commit comments

Comments
 (0)