Docker image for updating site

This commit is contained in:
Stefan Schlott 2022-08-26 18:30:50 +02:00
parent 422462ec6e
commit 3686d1c9d7
4 changed files with 63 additions and 0 deletions

39
scripts/update-site.sh Executable file
View 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"