forked from nvkelso/election-geodata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
29 lines (26 loc) · 1.3 KB
/
circle.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
machine:
environment:
# Do not use pyenv Python so apt-get installs work
PATH: /bin:/usr/bin:/usr/local/bin
dependencies:
override:
- sudo add-apt-repository -y ppa:migurski/electionsgeodata
- sudo apt-get update -y
- sudo apt-get install -y libgeos-c1v5=3.5.0-1~trusty1 gdal-bin=2.1.0+dfsg-1~trusty2
- sudo apt-get install -y python-mapnik python-requests imagemagick
test:
override:
- make out/render.png out/nation.gpkg
post:
- aws s3 cp --acl public-read out/render.png s3://$S3_BUCKET/commits/$CIRCLE_SHA1/render.png
- scripts/update-status.py https://s3.amazonaws.com/$S3_BUCKET/commits/$CIRCLE_SHA1/render.png
deployment:
published:
branch: master
commands:
- aws s3 cp --acl public-read --cache-control 'max-age=60 public' out/render.png s3://$S3_BUCKET/branches/$CIRCLE_BRANCH/render.png
- ogr2ogr out/nation.shp out/nation.gpkg
- gzip -9 out/nation.gpkg
- aws s3 cp --acl public-read --content-encoding gzip --content-type application/geopackage out/nation.gpkg.gz s3://$S3_BUCKET/branches/$CIRCLE_BRANCH/nation.gpkg
- zip -j out/nation.zip out/nation.shp out/nation.shx out/nation.prj out/nation.dbf
- aws s3 cp --acl public-read --content-type application/zip out/nation.zip s3://$S3_BUCKET/branches/$CIRCLE_BRANCH/nation-shp.zip