more work on fedora-web/build role

Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
Rick Elrod 2015-07-09 18:06:30 +00:00
parent f6bef5aa9a
commit ef1d39be21
6 changed files with 190 additions and 10 deletions

View file

@ -0,0 +1,2 @@
MAILTO=web-members@fedoraproject.org
0 * * * * apache /usr/local/bin/lock-wrapper syncStatic /usr/local/bin/syncStatic

View file

@ -0,0 +1,70 @@
#!/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-web/.git ]
then
/usr/bin/git clone -q \
git://git.fedorahosted.org/fedora-web.git \
/srv/web/fedora-web
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 bapp02::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-web
/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
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 getfedora.org
build spins.fedoraproject.org
build boot.fedoraproject.org
build fedoracommunity.org
build fudcon.fedoraproject.org
build start.fedoraproject.org

View file

@ -0,0 +1,70 @@
#!/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-web/.git ]
then
/usr/bin/git clone -q \
git://git.fedorahosted.org/fedora-web.git \
/srv/web/fedora-web
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 bapp02::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-web
/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 spins.fedoraproject.org
build getfedora.org
build labs.fedoraproject.org
build arm.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 boot.fedoraproject.org
build fedoracommunity.org
build fudcon.fedoraproject.org
build start.fedoraproject.org

View file

@ -0,0 +1,2 @@
MAILTO=web-members@fedoraproject.org
0 * * * * apache /usr/local/bin/lock-wrapper syncTranslations /usr/local/bin/syncTranslations.sh | /usr/local/bin/nag-once syncTranslations 1d 2>&1

View file

@ -0,0 +1,30 @@
#!/bin/bash
# this script pull all translations from the zanata Websites project.
# It pulls every resources.
PO_DIR=/var/tmp/po_dir
SITES="boot.fedoraproject.org \
fedoracommunity.org \
fedorahosted.org \
fedoraproject.org \
getfedora.org \
spins.fedoraproject.org \
labs.fedoraproject.org \
arm.fedoraproject.org \
start.fedoraproject.org"
# hack for zanata-client, since it currently only is able to find
# config file in ~/.config/zanata.ini and apache's $HOME isn't a good location
export HOME=/var/lib/zanata
[ -d $PO_DIR ] || mkdir $PO_DIR
for site in $SITES
do
[ -d $PO_DIR/$site ] || mkdir -p $PO_DIR/$site
cp $HOME/sample.xml $PO_DIR/$site/zanata.xml
sed -i "s/@VERSION@/$site/" $PO_DIR/$site/zanata.xml
cd $PO_DIR/$site
zanata pull
done

View file

@ -32,25 +32,31 @@
copy: >
src=syncStatic.stg.sh dest=/usr/local/bin/syncStatic user=root group=root
mode=0755
tags:
- fedora-web
- name: Copy syncStatic script (prod)
when: env == "production"
copy: >
src=syncStatic.sh dest=/usr/local/bin/syncStatic user=root group=root
mode=0755
tags:
- fedora-web
- name: Copy syncTranslations script
copy: >
src=syncTranslations.sh dest=/usr/local/bin/syncTranslations.sh user=root
group=root mode=0755
tags:
- fedora-web
# TODO: Cron jobs
## Install the cron job
#- name: Install the easyfix cronjob
# copy: >
# src=easyfix.cron dest=/etc/cron.d/easyfix.cron
# owner=root group=root mode=0644
# tags:
# - files
# - easyfix
- name: Install the syncStatic and syncTranslations cronjobs
copy: >
src={{item}}.cron dest=/etc/cron.d/{{item}}.cron
owner=root group=root mode=0644
with_items:
- syncStatic
- syncTranslations
tags:
- fedora-web
- cron