summaryrefslogtreecommitdiffstats
path: root/roles/fedora-web/build/files/syncStatic.sh
blob: c3bae6a0fabb324a52c4c29006b81b600a580ce8 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# mmcgrath@redhat.com 09-20-2007
#

function build {
    site="$1"
    err=$(
        {
            cd "$site" && \
            make syncpos && \
            make && \
            rsync -qa --delete-after --delay-updates out/ "/srv/web/$site/"; \
        } 2>&1
    )

    rc=$?
    if [ $rc -ne 0 ]; then
        echo "$site build failed"
        echo "===================================="
        echo "$err"
        echo
    fi

    return $rc;
}

if [ ! -d  /srv/web/fedora-websites/.git ]
then
    /usr/bin/git clone -q \
        https://pagure.io/fedora-websites.git \
        /srv/web/fedora-websites
fi

# Freeze the website to prepare beta changes.  On release day, comment the git
# checkout line below, run this script, and use:
# sudo func proxy\* call command run "/usr/bin/rsync -a --no-owner --no-group sundries01::fedoraproject.org/* /srv/web/fedoraproject.org/"
# on puppet1 to update the website.
#
# For any other last-minute changes or fixes, make the necessary changes in the
# fedora-web repo, then run this script and the above func command.
#
# Good luck!

cd /srv/web/fedora-websites

/usr/bin/git clean -q -fdx || exit 1
/usr/bin/git reset -q --hard || exit 1
/usr/bin/git checkout -q master || exit 1

/usr/bin/git pull -q --ff-only || exit 1
build labs.fedoraproject.org
build arm.fedoraproject.org
build getfedora.org
build alt.fedoraproject.org

pushd mirrors.fedoraproject.org > /dev/null
rsync -qa --delete-after --delay-updates . /srv/web/mirrors.fedoraproject.org/
popd > /dev/null

# Make sure everything else builds from master.
/usr/bin/git clean -q -fdx || exit 1
/usr/bin/git reset -q --hard || exit 1
/usr/bin/git checkout -q master || exit 1

/usr/bin/git pull -q --ff-only || exit 1

build flocktofedora.org
build spins.fedoraproject.org
build boot.fedoraproject.org
build fedoracommunity.org
build fudcon.fedoraproject.org
build start.fedoraproject.org
build fedoraproject.org

if [ ! -d  /srv/web/budget.fedoraproject.org/.git ]
then
    /usr/bin/git clone -q \
        https://pagure.io/fedora-budget-site.git \
        /srv/web/budget.fedoraproject.org
fi

cd /srv/web/budget.fedoraproject.org
/usr/bin/git clean -q -fdx || exit 1
/usr/bin/git reset -q --hard || exit 1
/usr/bin/git checkout -q prod || exit 1
/usr/bin/git pull -q --ff-only || exit 1