Files
shields/Makefile
Paul Melnikow c5e31b5de1 Fix frontend deploy and Heroku staging (#1288)
- Heroku reads the Node version from package.json. We're about to upgrade to Node 8 so this change to `engines` is only pre-emptive. It won't have any effect on the production servers.
- The production deploy scripts were missing the frontend files. This fixes that.
- This modifies the build setup to allow `BASE_URL=/`, which makes all requests relative to the page itself. That simplifies deploying the "debugging" frontend to the production servers, and makes it easy to host the frontend on Heroku.
2017-11-29 17:59:01 -05:00

67 lines
1.7 KiB
Makefile

all: website favicon test
favicon:
node lib/badge-cli.js '' '' '#bada55' .png > favicon.png
website:
LONG_CACHE=false BASE_URL=/ npm run build
deploy: website deploy-s0 deploy-s1 deploy-s2 deploy-gh-pages
deploy-s0:
# Ship a copy of the front end to each server for debugging.
# https://github.com/badges/shields/issues/1220
git add -f Verdana.ttf private/secret.json build/
git commit -m'MUST NOT BE ON GITHUB'
git push -f s0 HEAD:master
git reset HEAD~1
git checkout master
deploy-s1:
git add -f Verdana.ttf private/secret.json build/
git commit -m'MUST NOT BE ON GITHUB'
git push -f s1 HEAD:master
git reset HEAD~1
git checkout master
deploy-s2:
git add -f Verdana.ttf private/secret.json build/
git commit -m'MUST NOT BE ON GITHUB'
git push -f s2 HEAD:master
git reset HEAD~1
git checkout master
deploy-gh-pages:
(LONG_CACHE=true BASE_URL=https://img.shields.io npm run build && \
git checkout -B gh-pages master && \
git add -f index.html && \
git commit -m '[DEPLOY] Build index.html' && \
git push -f origin gh-pages:gh-pages) || git checkout master
git checkout master
deploy-heroku:
git add -f Verdana.ttf private/secret.json build/
git commit -m'MUST NOT BE ON GITHUB'
git push -f heroku HEAD:master
git reset HEAD~1
(git checkout -B gh-pages && \
git merge master && \
git push -f origin gh-pages:gh-pages) || git checkout master
git checkout master
setup:
curl http://download.redis.io/releases/redis-2.8.8.tar.gz >redis.tar.gz \
&& tar xf redis.tar.gz \
&& rm redis.tar.gz \
&& mv redis-2.8.8 redis \
&& cd redis \
&& make
redis:
./redis/src/redis-server
test:
npm test
.PHONY: all favicon website deploy deploy-s0 deploy-s1 deploy-s2 deploy-gh-pages deploy-heroku setup redis test