mirror of https://github.com/FreeCol/freecol.git
Update the website upload script (incremental mode no longer works).
This commit is contained in:
parent
751a5bbe55
commit
12f4b13787
|
@ -1,11 +1,13 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Upload the website
|
# Upload the website
|
||||||
#
|
#
|
||||||
# Default is to upload what changed recently, with -g from a specific commit.
|
# Former default is to upload what changed recently, with -g from a
|
||||||
# -a just uploads all of it.
|
# specific commit. -a just uploads all of it. But with the jekyll
|
||||||
|
# stage, we can not reliably tell what has changed, so now defaulting to
|
||||||
|
# full upload.
|
||||||
#
|
#
|
||||||
set -xv
|
#set -xv
|
||||||
MODE=prev
|
MODE=all
|
||||||
while test "x$1" != "x" ; do
|
while test "x$1" != "x" ; do
|
||||||
case "x$1" in
|
case "x$1" in
|
||||||
"x-a")
|
"x-a")
|
||||||
|
@ -26,14 +28,24 @@ if test "x$USERNAME" = "x" ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
WEBDIR=www.freecol.org
|
WEBDIR=www.freecol.org
|
||||||
|
if test ! -d "$WEBDIR" ; then
|
||||||
|
echo "run from the top of the source tree, $WEBDIR should be a subdirectory" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build the website
|
||||||
|
(cd "$WEBDIR" ; jekyll build) || exit $?
|
||||||
|
|
||||||
if test "x$MODE" = "xall" ; then
|
if test "x$MODE" = "xall" ; then
|
||||||
{
|
{
|
||||||
echo "cd /home/project-web/freecol/htdocs"
|
echo "cd /home/project-web/freecol/htdocs"
|
||||||
find www.freecol.org -type f -print \
|
find "$WEBDIR/_site" -type f -print \
|
||||||
| sed -e 's|^www.freecol.org/\(.*\)$|put \1 \1|'
|
| sed -n -e "s|^$WEBDIR/_site/"'\(.*\)$|put \1 \1|p'
|
||||||
} | (cd "$WEBDIR" ; sftp $USERNAME,freecol@web.sf.net)
|
} | (cd "$WEBDIR/_site" ; sftp $USERNAME,freecol@web.sf.net)
|
||||||
else
|
else
|
||||||
|
echo "incremental mode disabled" >&2
|
||||||
|
exit 1
|
||||||
|
|
||||||
if test "x$MODE" = "xprev" ; then
|
if test "x$MODE" = "xprev" ; then
|
||||||
PREV=`git log --pretty=oneline "$WEBDIR" | sed -n -e '2s/^\([^ ]*\).*$/\1/p'`
|
PREV=`git log --pretty=oneline "$WEBDIR" | sed -n -e '2s/^\([^ ]*\).*$/\1/p'`
|
||||||
else
|
else
|
||||||
|
@ -41,6 +53,6 @@ else
|
||||||
fi
|
fi
|
||||||
{
|
{
|
||||||
echo "cd /home/project-web/freecol/htdocs"
|
echo "cd /home/project-web/freecol/htdocs"
|
||||||
git diff --name-only "$PREV" HEAD -- "$WEBDIR" | sed -e 's|^[^/]*/\(.*\)$|put \1 \1|p'
|
git diff --name-only "$PREV" HEAD -- "$WEBDIR" | sed -n -e 's|^[^/]*/\(.*\)$|put \1 \1|p'
|
||||||
} | (cd "$WEBDIR" ; sftp $USERNAME,freecol@web.sf.net)
|
} | cat #(cd "$WEBDIR" ; sftp $USERNAME,freecol@web.sf.net)
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue