Skip to content

Commit

Permalink
Removed Circle configuration and cleaned up build script
Browse files Browse the repository at this point in the history
  • Loading branch information
migurski committed Sep 12, 2017
1 parent e859d94 commit b04e930
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
out
.DS_Store
env.ini
docker/env.ini
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ all: out/render.png
clean:
rm -rf out

# To build and publish rendered map, collected data, and Github status,
# create docker/env.ini from template in docker/env.ini-sample.
status:
docker build -t nvkelso/elections-geodata docker
docker run --env-file env.ini --rm -v `pwd`:/vol -w /vol nvkelso/elections-geodata
docker run --env-file docker/env.ini --rm -v `pwd`:/vol -w /vol nvkelso/elections-geodata

.PHONY: all clean status

Expand Down
15 changes: 0 additions & 15 deletions circle.yml

This file was deleted.

16 changes: 11 additions & 5 deletions docker/build-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@ RENDER_PATH=$S3_BUCKET/commits/$GIT_SHA1/render.png
aws --region us-east-1 s3 cp --acl public-read out/render.png s3://$RENDER_PATH
scripts/update-status.py https://s3.amazonaws.com/$RENDER_PATH

# Check if we're on the deploy branch.
# Deploy if we're on the deploy branch.
if [ $GIT_BRANCH = 'master' ]; then

# Upload render and data for this branch.
aws --region us-east-1 s3 cp --acl public-read --cache-control 'max-age=60 public' out/render.png s3://$S3_BUCKET/branches/$GIT_BRANCH/render.png
ogr2ogr out/nation.shp out/nation.gpkg
BRANCH_DIR=$S3_BUCKET/branches/$GIT_BRANCH
aws --region us-east-1 s3 cp --acl public-read --cache-control 'max-age=60 public' \
out/render.png s3://$BRANCH_DIR/render.png

gzip -9 out/nation.gpkg
aws --region us-east-1 s3 cp --acl public-read --content-encoding gzip --content-type application/geopackage out/nation.gpkg.gz s3://$S3_BUCKET/branches/$GIT_BRANCH/nation.gpkg
aws --region us-east-1 s3 cp --acl public-read --content-encoding gzip --content-type application/geopackage \
out/nation.gpkg.gz s3://$BRANCH_DIR/nation.gpkg

ogr2ogr out/nation.shp out/nation.gpkg
zip -j out/nation.zip out/nation.shp out/nation.shx out/nation.prj out/nation.dbf
aws --region us-east-1 s3 cp --acl public-read --content-type application/zip out/nation.zip s3://$S3_BUCKET/branches/$GIT_BRANCH/nation-shp.zip
aws --region us-east-1 s3 cp --acl public-read --content-type application/zip \
out/nation.zip s3://$BRANCH_DIR/nation-shp.zip

fi
File renamed without changes.

0 comments on commit b04e930

Please sign in to comment.