more work on fedora-web/build role
Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
parent
f6bef5aa9a
commit
ef1d39be21
6 changed files with 190 additions and 10 deletions
2
roles/fedora-web/build/files/syncStatic.cron
Normal file
2
roles/fedora-web/build/files/syncStatic.cron
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
MAILTO=web-members@fedoraproject.org
|
||||||
|
0 * * * * apache /usr/local/bin/lock-wrapper syncStatic /usr/local/bin/syncStatic
|
70
roles/fedora-web/build/files/syncStatic.sh
Normal file
70
roles/fedora-web/build/files/syncStatic.sh
Normal 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
|
70
roles/fedora-web/build/files/syncStatic.stg.sh
Normal file
70
roles/fedora-web/build/files/syncStatic.stg.sh
Normal 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
|
2
roles/fedora-web/build/files/syncTranslations.cron
Normal file
2
roles/fedora-web/build/files/syncTranslations.cron
Normal 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
|
30
roles/fedora-web/build/files/syncTranslations.sh
Normal file
30
roles/fedora-web/build/files/syncTranslations.sh
Normal 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
|
||||||
|
|
|
@ -32,25 +32,31 @@
|
||||||
copy: >
|
copy: >
|
||||||
src=syncStatic.stg.sh dest=/usr/local/bin/syncStatic user=root group=root
|
src=syncStatic.stg.sh dest=/usr/local/bin/syncStatic user=root group=root
|
||||||
mode=0755
|
mode=0755
|
||||||
|
tags:
|
||||||
|
- fedora-web
|
||||||
|
|
||||||
- name: Copy syncStatic script (prod)
|
- name: Copy syncStatic script (prod)
|
||||||
when: env == "production"
|
when: env == "production"
|
||||||
copy: >
|
copy: >
|
||||||
src=syncStatic.sh dest=/usr/local/bin/syncStatic user=root group=root
|
src=syncStatic.sh dest=/usr/local/bin/syncStatic user=root group=root
|
||||||
mode=0755
|
mode=0755
|
||||||
|
tags:
|
||||||
|
- fedora-web
|
||||||
|
|
||||||
- name: Copy syncTranslations script
|
- name: Copy syncTranslations script
|
||||||
copy: >
|
copy: >
|
||||||
src=syncTranslations.sh dest=/usr/local/bin/syncTranslations.sh user=root
|
src=syncTranslations.sh dest=/usr/local/bin/syncTranslations.sh user=root
|
||||||
group=root mode=0755
|
group=root mode=0755
|
||||||
|
tags:
|
||||||
|
- fedora-web
|
||||||
|
|
||||||
# TODO: Cron jobs
|
- name: Install the syncStatic and syncTranslations cronjobs
|
||||||
|
copy: >
|
||||||
## Install the cron job
|
src={{item}}.cron dest=/etc/cron.d/{{item}}.cron
|
||||||
#- name: Install the easyfix cronjob
|
owner=root group=root mode=0644
|
||||||
# copy: >
|
with_items:
|
||||||
# src=easyfix.cron dest=/etc/cron.d/easyfix.cron
|
- syncStatic
|
||||||
# owner=root group=root mode=0644
|
- syncTranslations
|
||||||
# tags:
|
tags:
|
||||||
# - files
|
- fedora-web
|
||||||
# - easyfix
|
- cron
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue