Docker image for updating site
This commit is contained in:
parent
422462ec6e
commit
3686d1c9d7
4 changed files with 63 additions and 0 deletions
|
|
@ -5,4 +5,5 @@ set -u -e
|
|||
cd `dirname $0`/..
|
||||
|
||||
docker build -f Dockerfile-reminders -t cccs-reminders:latest .
|
||||
docker build -f Dockerfile-siteupdate -t cccs-siteupdate:latest .
|
||||
|
||||
|
|
|
|||
39
scripts/update-site.sh
Executable file
39
scripts/update-site.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
DEPLOY_TARGET="${1:-incontainer}"
|
||||
if [[ "$WEBSITE_SOURCE" == "" ]] ; then
|
||||
WEBSITE_SOURCE=`dirname $0`/..
|
||||
fi
|
||||
|
||||
# Update site
|
||||
cd $WEBSITE_SOURCE
|
||||
if [[ -d .git ]] ; then
|
||||
git pull || exit 1
|
||||
else
|
||||
git clone git@github.com:cccs/cccs-website.git . || exit 1
|
||||
fi
|
||||
|
||||
# Update Twitter
|
||||
cd $WEBSITE_SOURCE/content/_data
|
||||
../../scripts/update-twitter.sh
|
||||
git add twitter.csv
|
||||
git commit -m "Update Twitter"
|
||||
|
||||
# Update blog roll
|
||||
cd $WEBSITE_SOURCE/scripts
|
||||
./update-planetfeeds.rb ../content/_data/planetcccs-blogroll.yaml ../content/planet-cccs.yaml
|
||||
git add ../content/planet-cccs.yaml
|
||||
git commit -m "Update Planet"
|
||||
|
||||
# Push changes
|
||||
cd $WEBSITE_SOURCE
|
||||
git push
|
||||
|
||||
# Update site
|
||||
rm -rf tmp output
|
||||
#bundle exec nanoc || exit 1
|
||||
bundle exec nanoc
|
||||
rm -f crash.log
|
||||
umask 0002
|
||||
bundle exec nanoc deploy -t "$DEPLOY_TARGET"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue