Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip travis builds #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- "5"
script: ./renderAndPush.sh
cache:
directories:
- shapefiles
12 changes: 6 additions & 6 deletions Jakefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ file('shapefiles/sldl', { async: true }, () => {
'bash -c "' +
'cd ' + tempdir + ' && ' +
'wget -r -nH --cut-dirs=4 -nc ftp://ftp2.census.gov/geo/tiger/TIGER2014/SLDL && ' +
'unzip ./\*.zip && ' +
'unzip ./\\*.zip && ' +
'rm ./*.zip"',
'mv ' + tempdir + ' shapefiles/sldl'
], { printStdout: true, printStderr: true }, complete);
Expand All @@ -104,7 +104,7 @@ file('shapefiles/sldl', { async: true }, () => {
'bash -c "' +
'cd ' + tempdir + ' && ' +
'wget -r -nH --cut-dirs=4 -nc ftp://ftp2.census.gov/geo/tiger/TIGER2014/SLDL && ' +
'unzip ./\*.zip && ' +
'unzip ./\\*.zip && ' +
'rm ./*.zip"',
'mv ' + tempdir + ' shapefiles/sldl'
], { printStdout: true, printStderr: true }, complete);
Expand All @@ -118,7 +118,7 @@ file('shapefiles/sldu', { async: true }, () => {
'bash -c "' +
'cd ' + tempdir + ' && ' +
'wget -r -nH --cut-dirs=4 -nc ftp://ftp2.census.gov/geo/tiger/TIGER2014/SLDU && ' +
'unzip ./\*.zip && ' +
'unzip ./\\*.zip && ' +
'rm ./*.zip"',
'mv ' + tempdir + ' shapefiles/sldl'
], { printStdout: true, printStderr: true }, complete);
Expand All @@ -132,7 +132,7 @@ file('shapefiles/place', { async: true }, () => {
'bash -c "' +
'cd ' + tempdir + ' && ' +
'wget -r -nH --cut-dirs=4 -nc ftp://ftp2.census.gov/geo/tiger/TIGER2014/PLACE && ' +
'unzip ./\*.zip && ' +
'unzip ./\\*.zip && ' +
'rm ./*.zip"',
'mv ' + tempdir + ' shapefiles/place'
], { printStdout: true, printStderr: true }, complete);
Expand All @@ -146,7 +146,7 @@ file('shapefiles/county', { async: true }, () => {
'bash -c "' +
'cd ' + tempdir + ' && ' +
'wget -r -nH --cut-dirs=4 -nc ftp://ftp2.census.gov/geo/tiger/TIGER2014/COUNTY && ' +
'unzip ./\*.zip && ' +
'unzip ./\\*.zip && ' +
'rm ./*.zip"',
'mv ' + tempdir + ' shapefiles/county'
], { printStdout: true, printStderr: true }, complete);
Expand All @@ -163,7 +163,7 @@ file('shapefiles/cousub', { async: true }, () => {
'bash -c "' +
'cd ' + tempdir + ' && ' +
'wget -r -nH --cut-dirs=4 -nc ftp://ftp2.census.gov/geo/tiger/TIGER2014/COUSUB && ' +
'unzip ./\*.zip && ' +
'unzip ./\\*.zip && ' +
'rm ./*.zip"',
'mv ' + tempdir + ' shapefiles/cousub'
], { printStdout: true, printStderr: true }, complete);
Expand Down
28 changes: 28 additions & 0 deletions renderAndPush.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
set -euo pipefail

if ! git diff --quiet; then
echo "You have uncommitted changes that will be blown away!"
exit 1
fi

if ! git diff --cached --quiet; then
echo "You have uncommitted changes that will be blown away!"
exit 1
fi

if [ ! -d .git ]; then
git init
git config user.name "Travis-CI Deploy Bot"
git config user.email "[email protected]"
fi

# render everything
npm run render

git branch -D gh-pages 2>/dev/null || true
git checkout -b gh-pages
mv build/ocd-division .
git add ocd-division
git commit --quiet -m "Generated build at $(date)"
git push --force "https://x-api-token:${GITHUB_AUTH_TOKEN}@github.com/tdooner/brigade-maps.git" gh-pages