aboutsummaryrefslogtreecommitdiffstats
path: root/website/host-scripts/upload-website.sh
blob: 356134022131d7a5d0f3a70f3e4e2edd388226d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/sh

# Script to upload fetchmail website from Git repository
# (C) 2008 - 2010 by Matthias Andree. GNU GPL v3.

: ${BERLIOS_LOGIN=m-a}

# abort on error
set -eu

# cd to parent of script
cd "$(dirname "$0")"
cd ..

echo "==>  Running sanity checks"
# make sure we have no dangling symlinks
if LC_ALL=C file * | egrep broken\|dangling ; then
    echo "broken symlinks -> abort" >&2
    exit 1
fi

pids=

echo "==>  Uploading website (rsync) to BerliOS"
# upload
rsync \
    --chmod=ug=rwX,o=rX,Dg=s --perms \
    --copy-links --times --checksum --verbose \
    --exclude host-scripts \
    --exclude .git --exclude '*~' --exclude '#*#' \
    * \
    "$BERLIOS_LOGIN@shell.berlios.de:/home/groups/fetchmail/htdocs/" &
pids="$pids $!"

echo "==>  Uploading website (rsync) to local"
rsync \
    --chmod=ug=rwX,o=rX,Dg=s --perms \
    --copy-links --times --checksum --verbose \
    --exclude host-scripts \
    --exclude .git --exclude '*~' --exclude '#*#' \
    * \
    $HOME/public_html/fetchmail/info/ &
pids="$pids $!"

wait $pids

echo "==>  Synchronizing web dir."
synchome.sh

echo "==>  Done; check rsync output above for success."