summaryrefslogtreecommitdiff
blob: a58d6eef4e6af6e74aae457429e511247c25e929 (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
#!/bin/bash
DATE=$(date +%F)
LOG_DATE=$(date +%F-%R)
BASE_DIR="/var/www/planet.gentoo.org/"
RESTRICT=""
VENUS_DIR="/usr/lib/python2.6/site-packages/venus/"

cd ${BASE_DIR}

# Get latest SVN changes
#git pull ${BASE_DIR}/planet-gentoo/configs/ >/dev/null 2>&1
#git pull ${BASE_DIR}/planet-gentoo/templates/ >/dev/null 2>&1
git pull ${BASE_DIR}planet-gentoo/ >/dev/null 2>&1

# Run Venus
for x in planet universe; do
        if [[ ! -z $RESTRICT ]]; then
                for y in $RESTRICT; do
                        rm ${BASE_DIR}planet-gentoo/configs/${x}/${y}
                done
        fi
        cat ${BASE_DIR}planet-gentoo/configs/base/venus.${x} ${BASE_DIR}planet-gentoo/configs/${x}/* > ${BASE_DIR}generated_configs/venus.${x}.ini
        python ${VENUS_DIR}planet.py ${BASE_DIR}configs/venus.${x}.ini > ${BASE_DIR}logs/${x}/${LOG_DATE}.log 2>&1
done

# Delete old logs
find ${BASE_DIR}logs -type f -mtime +30 -delete

# Archive posts
cp ${BASE_DIR}htdocs/index.html \
        ${BASE_DIR}htdocs/archives/${DATE}.html
cp ${BASE_DIR}htdocs/universe/index.html \
        ${BASE_DIR}htdocs/universe/archives/${DATE}.html