scratch/tasks/ghpublish

46 lines
1.1 KiB
Text
Raw Normal View History

2011-04-20 13:09:17 +00:00
#!/usr/bin/env zsh
rootdir=$HOME/Sites/webroot
2011-04-20 13:38:41 +00:00
function debug {
print -- $*
eval $*
}
2011-04-20 13:09:17 +00:00
cd $rootdir || { print -- "Unable to go to $HOME/Sites/webroot"; exit 1 }
git co master || { exit 1 }
git pull || { exit 1 }
# empty regen depencies cache because of a bug
\rm -f ./tmp/*
./tasks/recompile
if git status | grep 'nothing to commit'>/dev/null 2>&1; then
else
git add .
git commit -m "regeneration"
fi
# update & push gh-pages
2011-04-20 13:38:41 +00:00
debug git co gh-pages
2011-04-20 13:09:17 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:38:41 +00:00
debug \rm -rf *(N)
2011-04-20 13:09:17 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:38:41 +00:00
debug git co master output
2011-04-20 13:21:02 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:38:41 +00:00
debug git unstage output
debug mv output/index.html .
2011-04-20 13:09:17 +00:00
(( $? == 0 )) || { exit 1 }
debug mv output/Scratch/* .
2011-04-20 13:09:17 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:38:41 +00:00
debug \rm -rf output
2011-04-20 13:27:06 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:38:41 +00:00
debug cp en/error/404-not_found/index.html 404.html
2011-04-20 13:09:17 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:38:41 +00:00
debug echo "yannesposito.com" > CNAME
2011-04-20 13:27:06 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:38:41 +00:00
debug git add .
2011-04-20 13:27:06 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:38:41 +00:00
debug git commit -m '"updated website"'
2011-04-20 13:09:17 +00:00
(( $? == 0 )) || { exit 1 }
2011-04-20 13:46:13 +00:00
debug git push origin gh-pages:gh-pages