Fix bug 1136559: Add dev deploy cron scripts to repo.

Also fix dev chief autodeploy script.
This commit is contained in:
Paul McLanahan 2015-02-25 13:42:18 -05:00
Родитель 87b2a34b30
Коммит 9ab3132f5e
4 изменённых файлов: 96 добавлений и 5 удалений

Просмотреть файл

@ -0,0 +1,44 @@
#!/bin/bash
#
# This must match the name of the webapp in the Chief configs (/var/www/chief/settings.py)
# This should be the only change you need to make.
WEBAPP="bedrock.dev"
function checkretval(){
retval=$?
if [[ $retval -gt 0 ]]; then
echo "Error!!! Exit status of the last command was $retval"
exit $retval
fi
}
# Get the sha currently deployed
SHADEPLOYED=$(curl -s -XGET https://www-dev.allizom.org/media/revision.txt)
SHAAVAILABLE=$(git ls-remote git://github.com/mozilla/bedrock.git master | awk '{print $1;}')
# Nix the 4 bytes before the sha because it's http smart protocol
#SHAAVAILABLE="${SHAAVAILABLE:4}"
echo "We have ${SHADEPLOYED:0:8} and ${SHAAVAILABLE:0:8} is available."
if [ "$SHADEPLOYED" = "$SHAAVAILABLE" ];
then
# Nothing to deploy
echo "Nothing to deploy."
exit 0
fi
# Here we will load the WEBAPPS object from the Chief configs and grab the update password for our $WEBAPP
PASSWORD=$(/data/bedrock-dev/src/www-dev.allizom.org-django/password.py)
# If there was an error in the python we will raise it here ($PASSWORD contains the error in this case)
if [ $? != 0 ]; then
echo -e "$PASSWORD"
exit 1
fi
echo "Calling Chief for '$WEBAPP' to deploy '${SHAAVAILABLE:0:8}'"
# This just creates a POST event to the Chief app. We populate the form fields with the information gathered above ($SHAAVAILABLE, $PASSWORD, $WEBAPP)
curl -s -F 'who=web-ops_cli_script' -F "password=$PASSWORD" -F "ref=$SHAAVAILABLE" http://$(hostname)/chief/$WEBAPP -o /dev/null
checkretval

Просмотреть файл

@ -0,0 +1,21 @@
#!/bin/bash
UPSTREAM=$(svn info https://svn.mozilla.org/projects/mozilla.com/trunk/locales | grep Revision | cut -f2 -d' ')
cd /data/bedrock-dev/src/www-dev.allizom.org-django/bedrock
pushd locale > /dev/null
RUNNING=$(svnversion ./ | tr -d '[A-Z]')
UPDATED=0
if [ "$RUNNING" != "$UPSTREAM" ]; then
svn cleanup
svn -q up
UPDATED=1
fi
popd > /dev/null
if [ $UPDATED -eq 1 ]; then
/data/bedrock-dev/deploy -q www-dev.allizom.org-django/bedrock/locale
else
# echo "Nothing to deploy."
exit 0
fi

Просмотреть файл

@ -0,0 +1,28 @@
#!/bin/sh
UPSTREAM=$(svn info https://svn.mozilla.org/projects/mozilla.org/trunk | grep Revision | cut -f2 -d' ')
cd /data/bedrock-dev/src/www-dev.allizom.org
RUNNING=$(svnversion ./ | tr -d '[A-Z]')
UPDATED=0
if [ "$RUNNING" != "$UPSTREAM" ]; then
svn cleanup
svn -q up
UPDATED=1
fi
cd org
RUNNING=$(svnversion ./ | tr -d '[A-Z]')
if [ "$RUNNING" != "$UPSTREAM" ]; then
svn cleanup
svn -q up
UPDATED=1
fi
if [ $UPDATED -eq 1 ]; then
/data/bedrock-dev/deploy www-dev.allizom.org > /dev/null 2>&1
else
# removing per bug 1087514
# echo "Nothing to deploy."
exit 0
fi

Просмотреть файл

@ -4,14 +4,12 @@
MAILTO="webops-cron@mozilla.com,cron-bedrock@mozilla.com"
0-59/10 * * * * root /data/bedrock-dev/src/update-www-dev.allizom.org.sh
# TODO Make this run chief
1-59/10 * * * * root /data/bedrock-dev/src/update-www-dev.allizom.org-django.sh
*/10 * * * * {{ user }} {{ source }}/bin/update-scripts/dev/update-dev-php.sh
*/10 * * * * {{ user }} {{ source }}/bin/update-scripts/dev/update-dev-django.sh
*/15 * * * * {{ user }} {{ source }}/bin/update-scripts/dev/update-dev-locale.sh
*/5 * * * * {{ django_manage }} rnasync > /dev/null 2>&1
*/15 * * * * root /data/bedrock-dev/src/update-www-dev.allizom.org-svn-locale.sh
# bug 1014586
3 */2 * * * {{ django_cron }} update_tweets > /dev/null 2>&1