Website/Makefile

34 lines
996 B
Makefile

BIO_DIR := ~/Documents/Administrivia/Bios
all:
node build.js
fetch:
@echo Retrieving Website Repo Head
@git pull
@if [ -f $(BIO_DIR)/Rakefile ] ; then \
echo "Fetching Updates"; \
/bin/bash -c "cd $(BIO_DIR); pwd; git pull;"\
echo "Building JSON"; \
rake -f $(BIO_DIR)/Rakefile -E "Dir.chdir(File.expand_path '$(BIO_DIR)')" okennedy.json;\
cp $(BIO_DIR)/okennedy.json src/metadata/;\
else\
echo "Fetching JSON";\
cd src/metadata;\
curl -O http://www.cse.buffalo.edu/~okennedy/okennedy.json;\
fi
push: fetch all
@echo "Cleaning up OSX Crap"
find . -name .DS_Store | xargs rm
@echo "Making sure that you've pushed the repo"
git add .; git commit; git push
@echo "Actually uploading the site"
rsync -avz -e ssh --safe-links --progress site/ okennedy@gram.cse.buffalo.edu:/var/www/static/
rsync -avz -e ssh --safe-links --progress static/ okennedy@gram.cse.buffalo.edu:/var/www/static/
open: all
open site/index.html
.PHONY: all fetch push open